/* =====================================================
   b2b.lunic.co.kr  —  공통 + 로그인 스타일
   - 디자인 컨셉: 물류(창고/트럭/박스) — 딥 네이비 + 앰버 액센트
   - 모바일 우선(반응형)
   ===================================================== */

:root {
  --bg:        #0b1320;
  --surface:   #131c2e;
  --card:      #1a2540;
  --line:      #2a3754;
  --text:      #e9eef7;
  --muted:     #99a3b8;
  --primary:   #10b981;       /* emerald 500 */
  --primary-d: #059669;       /* emerald 600 */
  --primary-l: #34d399;       /* emerald 400 */
  --primary-shadow: rgba(16,185,129,.30);
  --primary-glow:   rgba(16,185,129,.18);
  --accent:    #38bdf8;       /* sky 400 */
  --danger:    #ef4444;
  --ok:        #22c55e;
  --shadow:    0 20px 60px rgba(0,0,0,.45);
  --radius:    14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
               "Noto Sans KR", "맑은 고딕", "Malgun Gothic", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
}

/* ===========================
   로그인 화면 레이아웃
   =========================== */

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

/* 좌측 히어로 패널 */
.login-hero {
  position: relative;
  overflow: hidden;
  background: #0a1020;
  isolation: isolate;
}
/* 배경 이미지 별도 레이어 — ken-burns 줌 애니메이션용 */
.login-hero::after {
  content: "";
  position: absolute; inset: -3% -3%;
  z-index: -2;
  background: url('../img/login-hero.jpg') center/cover no-repeat;
  transform: scale(1.04);
  animation: heroZoom 22s ease-in-out infinite alternate;
  will-change: transform;
}
.login-hero::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11,19,32,.45) 0%, rgba(11,19,32,.20) 35%, rgba(11,19,32,.20) 65%, rgba(11,19,32,.85) 100%),
    linear-gradient(135deg, rgba(11,19,32,.40) 0%, rgba(11,19,32,.10) 60%, rgba(11,19,32,.0) 100%);
  pointer-events: none;
}
@keyframes heroZoom {
  from { transform: scale(1.04) translateX(0); }
  to   { transform: scale(1.10) translateX(-1%); }
}
.login-hero-inner {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: .2px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover, .brand:focus, .brand:visited { color: var(--text); text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(245,158,11,.35);
}
.brand-mark svg { width: 22px; height: 22px; color: #1a1109; }
/* RUNIC 로고는 검정 PNG → CSS 필터로 흰색화 */
.brand-logo {
  width: 40px; height: 40px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .96;
  flex-shrink: 0;
}
.brand-text { font-size: 18px; }
.brand-text small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }

.hero-title {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--primary-l) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: #d2dbed;
  font-size: 15px;
  max-width: 36ch;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}

.hero-bullets {
  list-style: none; padding: 0; margin: 18px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px 14px;
}
.hero-bullets li {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(11,19,32,.55);
  border: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(6px);
  padding: 6px 12px 6px 6px; border-radius: 999px;
  font-size: 13px; color: #e6edfb;
}
.hero-bullets svg { width: 14px; height: 14px; color: var(--primary-l); }
.hero-bullets img {
  width: 24px; height: 24px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

/* 우측 카드 패널 */
.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56,189,248,.06), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, var(--primary-glow), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0 0 22px; font-size: 22px; letter-spacing: -0.2px;
  position: relative; padding-bottom: 14px;
}
.login-card h1::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 40px; height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-l) 100%);
  border-radius: 2px;
}
.login-card p.lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f172a;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.field-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 18px; font-size: 13px; color: var(--muted);
}
.field-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.field-row input { accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d) 100%);
  color: #052b1f;
  font-weight: 700; font-size: 15px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px var(--primary-shadow), inset 0 1px 0 rgba(255,255,255,.20);
  transition: transform .04s ease, filter .15s ease;
}
.btn:hover  { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: not-allowed; filter: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.alert {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }
.alert-error { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #fecaca; }
.alert-info  { background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.35); color: #bae6fd; }

.foot {
  margin-top: 18px; text-align: center;
  font-size: 12px; color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: underline dotted; }

/* ===========================
   대시보드 (간단)
   =========================== */
.app-shell { min-height: 100vh; min-height: 100dvh; padding: 20px; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.app-main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.app-main h2 { margin: 0 0 12px; }
.app-link {
  color: var(--primary);
  text-decoration: none; font-weight: 600;
}

/* ===========================
   반응형: 태블릿 이하 (≤ 980px)
   =========================== */
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero {
    min-height: 46vh;
    min-height: 46dvh;
  }
  .login-hero-inner { padding: 26px 24px; gap: 18px; }
  .login-panel { padding: 28px 18px 36px; }
}

/* ===========================
   반응형: 모바일 (≤ 480px)
   - 히어로를 슬림 배너로 (브랜드 + 짧은 한 줄 카피만)
   - 부제/칩은 모바일에서 숨김 (정보 과잉 방지)
   - 폼이 화면 주인공이 되도록
   =========================== */
@media (max-width: 480px) {
  body { font-size: 15px; }

  .login-hero {
    min-height: 28vh;
    min-height: 28dvh;
    max-height: 38vh;
    max-height: 38dvh;
  }
  .login-hero-inner {
    padding: 18px 20px 18px;
    gap: 10px;
    justify-content: flex-start;
  }
  .brand { gap: 10px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-text { font-size: 14px; line-height: 1.15; }
  .brand-text small { font-size: 10.5px; margin-top: 3px; opacity: .85; }

  .hero-title {
    font-size: 19px;
    line-height: 1.3;
    margin: 4px 0 0;
    text-shadow: 0 2px 8px rgba(0,0,0,.55);
  }
  /* 모바일에선 부제·칩 숨김 — 깔끔한 카드 중심 레이아웃 */
  .hero-sub,
  .hero-bullets { display: none; }

  .login-panel {
    padding: 22px 18px 32px;
  }
  .login-card {
    padding: 26px 22px 24px;
    border-radius: 14px;
    margin-top: -28px;            /* 히어로와 살짝 겹쳐 카드가 떠오르듯 */
    position: relative; z-index: 2;
  }
  .login-card h1 { font-size: 22px; margin-bottom: 22px; padding-bottom: 12px; }
  .login-card h1::after { width: 36px; }
  .field input { font-size: 16px; padding: 13px 14px; } /* iOS 줌 방지 */
  .field { margin-bottom: 12px; }
}

/* 작은 모바일 (≤ 360px) — Galaxy Fold 닫힘 등 */
@media (max-width: 360px) {
  .hero-title { font-size: 17px; }
  .login-card { padding: 22px 18px 22px; }
  .login-card h1 { font-size: 20px; }
}

/* 큰 모니터 */
@media (min-width: 1500px) {
  .login-hero-inner { padding: 56px 64px; }
  .login-card { max-width: 460px; }
}

/* 다크 모드/라이트 모드 분기 없이 다크 한 가지 (의도) */

/* ===========================
   진입 애니메이션 (CSS keyframes — GSAP 없이 가벼움)
   =========================== */
@keyframes b2bFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes b2bFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes b2bFadeRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* hero 좌측: 위에서 부드럽게 등장 (스태거) */
.brand           { animation: b2bFadeUp .55s .05s both cubic-bezier(.2,.7,.2,1); }
.hero-title      { animation: b2bFadeUp .65s .25s both cubic-bezier(.2,.7,.2,1); }
.hero-sub        { animation: b2bFadeUp .60s .40s both cubic-bezier(.2,.7,.2,1); }
.hero-bullets li { animation: b2bFadeUp .50s both cubic-bezier(.2,.7,.2,1); }
.hero-bullets li:nth-child(1) { animation-delay: .55s; }
.hero-bullets li:nth-child(2) { animation-delay: .65s; }
.hero-bullets li:nth-child(3) { animation-delay: .75s; }

/* 우측 카드: 살짝 우측에서 페이드 (모바일은 위에서) */
.login-card {
  animation: b2bFadeRight .65s .15s both cubic-bezier(.2,.7,.2,1);
}
@media (max-width: 980px) {
  .login-card { animation-name: b2bFadeUp; }
}

/* 카드 내부 폼 요소: 스태거 페이드인 */
.login-card h1   { animation: b2bFadeUp .50s .35s both ease-out; }
.login-card .field   { animation: b2bFadeUp .50s both ease-out; }
.login-card .field:nth-of-type(1) { animation-delay: .45s; }
.login-card .field:nth-of-type(2) { animation-delay: .55s; }
.login-card .btn { animation: b2bFadeUp .50s .65s both ease-out; }
.login-card .alert { animation: b2bFadeUp .35s .25s both ease-out; }

/* 인터랙션: 버튼 hover lift, 카드 미세 hover */
.btn { transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease, filter .15s ease; }
.btn:hover  { transform: translateY(-1px); box-shadow: 0 14px 32px var(--primary-shadow), inset 0 1px 0 rgba(255,255,255,.20); filter: brightness(1.04); }
.btn:active { transform: translateY(1px); box-shadow: 0 6px 14px var(--primary-shadow), inset 0 1px 0 rgba(255,255,255,.20); }

.login-card { transition: box-shadow .3s ease, transform .3s ease; }
.login-card:focus-within {
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px var(--primary-l) inset;
}

.brand-logo { transition: transform .3s ease; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.05); }

.hero-bullets li { transition: transform .25s ease, background .25s ease; }
.hero-bullets li:hover { transform: translateY(-2px); background: rgba(11,19,32,.75); }

/* 모션 줄이기 — 접근성 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
