/* ============================================================
   Odin Planner — Auth Modal (로그인 / 회원가입)
   ============================================================ */

.auth-modal[hidden] { display: none !important; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: auth-fade .25s ease-out;
}
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 31, 31, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-modal__card {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--cream, #FFF9F4);
  border-radius: 28px;
  padding: 44px 36px 36px;
  box-shadow: 0 40px 80px -20px rgba(42, 31, 31, 0.35);
  animation: auth-rise .35s cubic-bezier(.22,1,.36,1);
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  color: var(--mute, #8A7878);
  border-radius: 50%;
  transition: background .15s ease, color .15s ease;
}
.auth-modal__close:hover {
  background: var(--coral-mist, #FFEAE5);
  color: var(--coral-deep, #C45F62);
}

/* Brand + Header */
.auth-modal__brand {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.auth-modal__brand .brand__mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--coral-grad, linear-gradient(135deg, #FFB8B0 0%, #F08A8E 50%, #E07478 100%));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -6px rgba(196, 95, 98, 0.45);
}
.auth-modal__brand .brand__mark img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.auth-modal__kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--coral-deep, #C45F62);
  text-align: center;
  margin: 0 0 14px;
  text-transform: uppercase;
  font-weight: 600;
}
.auth-modal__title {
  font-family: "Fraunces", "Noto Serif KR", serif;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 0 0 12px;
  color: var(--ink, #2A1F1F);
}
.auth-modal__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--coral-deep, #C45F62);
}
.auth-modal__sub {
  text-align: center;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mute, #8A7878);
  margin: 0 0 24px;
}

/* Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-2, #F5EDE6);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--mute, #8A7878);
  border-radius: 999px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.auth-tab.is-active {
  background: #fff;
  color: var(--coral-deep, #C45F62);
  font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(42, 31, 31, 0.12);
}

/* Social */
.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.auth-social__btn {
  appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line, #ECDFD5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-social__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(42, 31, 31, 0.18);
}
.auth-social__btn--google {
  background: #fff;
  color: #2A1F1F;
}
.auth-social__btn--apple {
  background: #000;
  color: #fff;
  border-color: #000;
}
.auth-social__ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auth-social__ico svg {
  width: 100%;
  height: 100%;
}

/* Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 4px 0 18px;
}
.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line, #ECDFD5);
}
.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 14px;
  background: var(--cream, #FFF9F4);
  font-size: 12px;
  color: var(--mute, #8A7878);
  letter-spacing: 0.05em;
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #2A1F1F);
  position: relative;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line, #ECDFD5);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink, #2A1F1F);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--coral, #F08A8E);
  box-shadow: 0 0 0 3px rgba(240, 138, 142, 0.18);
}

/* Password field */
.auth-pw-label {
  position: relative;
}
.auth-pw-label .auth-forgot {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 12px;
  color: var(--coral-deep, #C45F62);
  font-weight: 600;
  text-decoration: none;
}
.auth-pw-label .auth-forgot:hover { text-decoration: underline; }
.auth-pw {
  position: relative;
}
.auth-pw-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--mute, #8A7878);
  display: grid;
  place-items: center;
}
.auth-pw-toggle:hover { color: var(--ink, #2A1F1F); }

/* Keep checkbox */
.auth-keep {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  color: var(--ink, #2A1F1F) !important;
  cursor: pointer;
}
.auth-keep input { width: 18px; height: 18px; accent-color: var(--coral, #F08A8E); }

/* Submit */
.auth-submit {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  padding: 16px;
  background: var(--coral-grad, linear-gradient(135deg, #FFB8B0 0%, #F08A8E 50%, #E07478 100%));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: box-shadow .2s ease, transform .15s ease;
}
.auth-submit:hover {
  box-shadow: 0 16px 32px -10px rgba(196, 95, 98, 0.6);
}
.auth-submit:active { transform: scale(0.98); }

/* Signup-only fields hidden by default */
.auth-modal[data-mode="signup"] .auth-pw-label .auth-forgot,
.auth-modal[data-mode="signup"] .auth-keep {
  display: none;
}

/* Lock body scroll */
body.auth-open { overflow: hidden; }

@media (max-width: 480px) {
  .auth-modal__card { padding: 36px 22px 24px; border-radius: 22px; }
  .auth-modal__title { font-size: 24px; }
  .auth-social { grid-template-columns: 1fr; }
}
