/* Login — 기존 카드 크기 기준 + 피그마 스타일 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --login-blue: #0051FF;
  --login-gray: #838383;
  --login-ink: #111111;
  --login-line: #d0d4db;
  --login-bg: #f2f3f5;
  --login-info-bg: #eef2ff;
  --login-card-r: 24px;
  --login-card-w: 420px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html,
body {
  min-height: 100%;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--login-bg);
  color: var(--login-ink);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-b));
  gap: 22px;
}

/* ── Logo ── */
.login-brand {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.login-brand img {
  width: min(200px, 52vw);
  height: auto;
  display: block;
}

/* ── Card ── */
.card {
  width: min(100%, var(--login-card-w));
  background: #fff;
  border: none;
  border-radius: var(--login-card-r);
  padding: 28px 28px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(16, 21, 28, 0.08);
  animation: login-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Tabs ── */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  margin: 0 auto 20px;
  height: 44px;
  background: #eceef2;
  border-radius: 999px;
  padding: 4px;
  flex-shrink: 0;
}

.tabs-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.tabs[data-active='owner'] .tabs-thumb {
  transform: translateX(100%);
}

.tabs[data-active='staff'] .tabs-thumb {
  transform: translateX(200%);
}

.tab {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--login-gray);
  cursor: pointer;
  transition: color 0.2s;
}

.tab.on {
  color: var(--login-blue);
}

/* ── Panels ── */
.panel {
  display: none;
  flex: 1;
  flex-direction: column;
  width: 100%;
}

.panel.on {
  display: flex;
}

.heading {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.04em;
  color: var(--login-ink);
  margin: 2px 0 0;
}

.sub {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.03em;
  color: var(--login-gray);
  margin: 6px 0 16px;
}

/* ── Info box ── */
.info {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  background: var(--login-info-bg);
  border: 1px solid var(--login-blue);
  border-radius: 12px;
  color: var(--login-blue);
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.info .info-line1,
.info .info-line2 {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.info.info-staff strong {
  font-weight: 700;
}

/* ── Floating fields (로그인 카드 전용 — 모달 .f 와 분리) ── */
.card .f {
  position: relative;
  margin-bottom: 16px;
}

.card .f input {
  width: 100%;
  padding: 22px 2px 10px;
  border: none;
  border-bottom: 1.5px solid var(--login-line);
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  color: var(--login-ink);
  letter-spacing: -0.02em;
  outline: none;
  transition: border-color 0.2s;
}

.card .f input:focus {
  border-bottom-color: var(--login-blue);
}

.card .f label {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-42%);
  font-size: 15px;
  font-weight: 600;
  color: var(--login-gray);
  letter-spacing: -0.03em;
  pointer-events: none;
  transition: top 0.2s ease, transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
  line-height: 1.2;
}

.card .f input:focus + label,
.card .f input:not(:placeholder-shown) + label {
  top: 2px;
  transform: translateY(0);
  font-size: 11px;
  font-weight: 700;
  color: var(--login-blue);
}

.card .f input:not(:focus):not(:placeholder-shown) + label {
  color: var(--login-gray);
}

.hint {
  font-size: 11px;
  color: var(--login-gray);
  margin-top: 6px;
  letter-spacing: -0.02em;
}

/* ── Remember ── */
.remember {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 2px 0 16px;
  cursor: pointer;
}

.remember input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--login-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.remember span {
  font-size: 13px;
  color: var(--login-ink);
  line-height: 1.45;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.remember span em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--login-gray);
  line-height: 1.45;
}

/* ── Login button ── */
.btn {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  background: var(--login-blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  flex-shrink: 0;
}

.btn:hover {
  background: #0046e0;
  box-shadow: 0 6px 18px rgba(0, 81, 255, 0.28);
  transform: translateY(-1px);
}

.btn:disabled {
  background: #c5cad3;
  color: #fff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn .sp {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn.ld .bt {
  display: none;
}

.btn.ld .sp {
  display: block;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

.msg {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  display: none;
  letter-spacing: -0.02em;
}

.msg.err {
  background: #fff0f0;
  color: #e5484d;
  border: 1px solid #ffcdd2;
}

.msg.ok {
  background: #f0fff4;
  color: #12a150;
  border: 1px solid #c6f6d5;
}

.msg.show {
  display: block;
  animation: login-fi 0.3s;
}

.expired-sub-open {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: #0051ff;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@keyframes login-fi {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Footer links ── */
.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.login-footer a,
.login-footer button {
  appearance: none;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--login-gray);
  text-decoration: none;
  cursor: pointer;
  padding: 4px 10px;
  transition: color 0.15s;
}

.login-footer a:hover,
.login-footer button:hover {
  color: var(--login-blue);
}

.login-footer .sep {
  width: 1px;
  height: 12px;
  background: #c8ccd3;
  flex-shrink: 0;
}

/* ── Leave modal ── */
.leave-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.leave-modal[hidden] {
  display: none;
}

.leave-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  pointer-events: none;
}

.leave-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.leave-modal-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
}

.leave-modal-box p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--login-gray);
}

.leave-modal-box .btn {
  height: 44px;
  font-size: 15px;
  margin-top: 0;
}

/* ── ≤550: 해상도가 작아질수록 점진 축소 + 좌우 여백 유지 ── */
@media (max-width: 550px) {
  .page {
    padding: max(16px, 4.5vw) max(16px, 4.5vw) calc(16px + var(--safe-b));
    gap: clamp(12px, 3.2vw, 18px);
  }

  .login-brand img {
    width: clamp(120px, 38vw, 168px);
  }

  .card {
    width: 100%;
    max-width: min(100%, calc(100vw - 2 * max(16px, 4.5vw)));
    padding: clamp(16px, 4.2vw, 22px) clamp(14px, 4vw, 18px) clamp(14px, 3.8vw, 20px);
    border-radius: clamp(16px, 4vw, 20px);
  }

  .tabs {
    height: clamp(36px, 10vw, 42px);
    margin-bottom: clamp(12px, 3.2vw, 16px);
    padding: 3px;
  }

  .tabs-thumb {
    top: 3px;
    left: 3px;
    /* 탭 3등분과 동일 폭 — 50%면 인접 탭을 침범함 */
    width: calc((100% - 6px) / 3);
    height: calc(100% - 6px);
  }

  .tab {
    font-size: clamp(12px, 3.4vw, 14px);
  }

  .heading {
    font-size: clamp(16px, 4.6vw, 18px);
  }

  .sub {
    font-size: clamp(11px, 3.2vw, 12.5px);
    margin-bottom: clamp(12px, 3vw, 16px);
  }

  .info {
    padding: clamp(10px, 2.8vw, 12px) clamp(10px, 3vw, 14px);
    margin-bottom: clamp(12px, 3.2vw, 16px);
    border-radius: 10px;
  }

  .info .info-line1,
  .info .info-line2 {
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .card .f {
    margin-bottom: clamp(12px, 3.2vw, 16px);
  }

  .card .f input {
    font-size: clamp(13px, 3.6vw, 15px);
    padding: clamp(18px, 5vw, 22px) 2px clamp(8px, 2vw, 10px);
  }

  .card .f label {
    font-size: clamp(13px, 3.6vw, 15px);
  }

  .card .f input:focus + label,
  .card .f input:not(:placeholder-shown) + label {
    font-size: clamp(10px, 2.8vw, 11px);
  }

  .remember {
    margin-bottom: clamp(12px, 3vw, 16px);
    gap: 8px;
  }

  .remember span {
    font-size: clamp(11px, 3.2vw, 13px);
  }

  .remember span em {
    font-size: clamp(10px, 2.8vw, 12px);
  }

  .btn {
    height: clamp(42px, 11vw, 48px);
    font-size: clamp(13px, 3.6vw, 15px);
    border-radius: 11px;
  }

  .login-footer a,
  .login-footer button {
    font-size: clamp(11px, 3.2vw, 13px);
    padding: 4px clamp(4px, 1.6vw, 7px);
  }

  .login-footer .sep {
    height: 11px;
  }
}

@media (max-width: 380px) {
  .page {
    padding: 14px 14px calc(14px + var(--safe-b));
  }

  .card {
    padding: 14px 14px 16px;
  }
}
