﻿@import url("Design.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  position: relative;
  font-family: "Cormorant Garamond", serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 211, 143, 0.18), transparent 32%),
    linear-gradient(135deg, #1b120d 0%, #2c1a12 35%, #170d08 100%);
  color: #3b1f0f;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.5;
  z-index: 0;
}

body::before {
  width: 220px;
  height: 220px;
  background: rgba(249, 170, 90, 0.22);
  top: 8%;
  left: 8%;
}

body::after {
  width: 260px;
  height: 260px;
  background: rgba(134, 206, 218, 0.15);
  right: 10%;
  bottom: 8%;
}

.account-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  z-index: 100;
}

.bg-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.account-page .title-small {
  position: absolute;
  top: -2vh;
  left: 50%;
  right: auto;
  transform: translateX(-50%) scale(1);
  opacity: 1 !important;
  width: min(260px, 30vw);
  height: auto;
  z-index: 101;
  pointer-events: none;
}

.auth-layout {
  position: absolute;
  top: 50%;
  right: 4%;
  left: auto;
  width: min(360px, calc(100% - 48px));
  transform: translate(0, -50%);
  display: block;
  z-index: 101;
}

.auth-card {
  margin: auto;
}

.auth-card {
  position: relative;
  padding: 10px;
  border-radius: 30px;
  min-height: auto;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 232, 0.98),
    rgba(239, 224, 189, 0.96)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 26px 46px rgba(33, 18, 10, 0.36),
    0 8px 18px rgba(91, 60, 29, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: visible;
  z-index: 102;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Close button styling specific to the auth card */
.auth-card .close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 2px solid rgba(90, 56, 28, 0.25);
  box-shadow: 0 12px 22px rgba(33, 18, 10, 0.18);
  cursor: pointer;
  z-index: 110;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.auth-card .close-btn img {
  width: 44px;
  height: 60px;
  display: block;
  object-fit: contain;
  opacity: 0.95;
}

.auth-card .close-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 26px rgba(33, 18, 10, 0.22);
}

.auth-card::before,
.auth-card::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 80px;
  left: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.24),
    transparent 52%
  );
  pointer-events: none;
}

.auth-card::before {
  top: -18px;
  transform: rotate(2deg);
}

.auth-card::after {
  bottom: -18px;
  transform: rotate(-2deg);
}

.auth-card__title {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.wood-sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 32px;
  background: linear-gradient(180deg, #6a402b 0%, #402514 100%);
  color: #fde2c8;
  font-family: "Cinzel", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-panel {
  display: none;
  flex-direction: column;
  padding: 6px 6px;
  gap: 10px;
}

.auth-panel.visible {
  display: flex;
}

.auth-panel.hidden {
  display: none;
}

.auth-card__footer {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.text-btn {
  background: transparent;
  border: none;
  color: #6a3f1f;
  font-family: "Cinzel", serif;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.guest-btn {
  width: 100%;
}

.auth-panel h3 {
  color: #4a2e16;
  font-size: 26px;
  line-height: 1.15;
  text-align: center;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.18);
}

.auth-panel--logging {
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.login-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 18px;
  text-align: center;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border: 8px solid rgba(106, 63, 31, 0.18);
  border-top-color: #6a3f1f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-title {
  font-size: 32px;
  font-weight: 800;
  color: #4a2e16;
  letter-spacing: 0.03em;
}

.loading-text {
  max-width: 300px;
  color: #5f3f25;
  font-size: 16px;
  line-height: 1.55;
}

.auth-panel form {
  display: grid;
  gap: 12px;
}

.auth-panel label {
  color: #5a2e3b;
  font-size: 13px;
  font-weight: 700;
  font-family: "Cinzel", serif;
}

.input-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(138, 85, 45, 0.24);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.05);
}

.visibility-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 12px;
  background: rgba(107, 76, 55, 0.08);
  color: #5b3520;
  cursor: pointer;
  font-size: 1rem;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.visibility-toggle:hover {
  background: rgba(107, 76, 55, 0.16);
  transform: translateY(-1px);
}

.visibility-icon {
  width: 1em;
  height: 1em;
  pointer-events: none;
}

.visibility-icon--slash {
  display: none;
}

.visibility-toggle[aria-pressed="true"] .visibility-icon--eye {
  display: none;
}

.visibility-toggle[aria-pressed="true"] .visibility-icon--slash {
  display: inline-block;
}

.field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #6a3f1e;
  font-size: 1rem;
}

.field-icon img {
  width: 34px;
  height: 34px;
  display: block;
}

.input-row input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #3b1f0f;
  font-size: 1rem;
  font-family: inherit;
}

.input-row input::placeholder {
  color: #8a6f56;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.primary-btn {
  background: linear-gradient(180deg, #8c6039 0%, #5a361a 100%);
  color: #ffe8c5;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.secondary-link {
  display: inline-block;
  text-align: center;
  color: #6a3f1f;
  font-size: 0.92rem;
  text-decoration: underline;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.resend-verify-btn[hidden] {
  display: none;
}

.reset-step {
  display: none;
  gap: 14px;
}

.reset-step.visible {
  display: grid;
  justify-items: center;
}

.hint-text {
  color: #5f3f25;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.reset-step .input-row,
.reset-step label {
  width: 100%;
}

.reset-step .primary-btn {
  width: 100%;
  max-width: 260px;
}

/* ── Status messages ────────────────────────────── */
.auth-status {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 28px));
  padding: 12px 16px 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(46, 32, 22, 0.9);
  color: #f7e6d8;
  box-shadow: 0 18px 30px rgba(17, 9, 5, 0.34);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.auth-status:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.auth-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.auth-status.success {
  background: rgba(31, 95, 54, 0.9);
  color: #e9fff1;
}

.auth-status.error {
  background: rgba(110, 30, 22, 0.9);
  color: #ffe8e4;
}

.auth-status.info {
  background: rgba(39, 88, 125, 0.9);
  color: #e7f4ff;
}

/* ── Loading state on buttons ─────────────────── */
.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.primary-btn .spinner,
.secondary-btn .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffe8c5;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #3b2b1f;
  color: #f7e5c0;
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.24);
}

.secondary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.account-panel {
  width: 340px;
  border-radius: 18px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f7efe3 0%, #ead9bb 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.account-subheader {
  text-align: center;
  margin-bottom: 10px;
}
.account-subheader .sublabel {
  font-size: 12px;
  color: #6a3f1f;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.account-subheader .greeting {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  color: #4a2e16;
  margin: 6px 0 0;
}

.close-btn.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
  background: rgba(67, 40, 25, 0.08);
  border: none;
  cursor: pointer;
}

.account-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.account-nav {
  width: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-nav .nav-item {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  color: #57321e;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-nav .nav-item .icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #7a4f36;
  color: #fde2c8;
  border-radius: 6px;
  font-size: 14px;
}
.account-nav .nav-item .label {
  display: inline-block;
  vertical-align: middle;
}
.account-nav .nav-item.active {
  background: linear-gradient(180deg, #efe1c8, #e3c9a9);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.account-content {
  flex: 1;
  min-height: 260px;
  padding: 20px;
}

.account-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, #fff, #f7f0df);
  padding: 12px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(107, 76, 55, 0.08);
}
.account-card__left {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.avatar-wrap img {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  border: 4px solid rgba(255, 255, 255, 0.6);
}
.account-card__right {
  flex: 1;
}
.account-card__right h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #5a3724;
  font-size: 16px;
}

.small-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #7a4f36, #59351f);
  color: #fde2c8;
  border: none;
  font-weight: 700;
}
.small-btn:hover {
  transform: translateY(-2px);
}

.save-exit {
  width: 100%;
  padding: 12px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f1c84b, #e0b338);
  color: #5a3516;
  font-weight: 900;
  box-shadow: 0 12px 18px rgba(224, 162, 38, 0.25);
  border: none;
  margin-bottom: 10px;
}
.save-exit:hover {
  transform: translateY(-2px);
}
.signout-outline {
  width: 100%;
  padding: 12px 18px;
  border-radius: 18px;
  background: transparent;
  color: #5a3516;
  font-weight: 800;
  border: 2px solid rgba(90, 53, 22, 0.18);
}

/* subtle entrance */
.account-panel.visible {
  animation: panelIn 320ms cubic-bezier(0.2, 0.9, 0.26, 1);
}
@keyframes panelIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* optimize animations */
.nav-item,
.small-btn,
.save-exit,
.signout-outline {
  will-change: transform, opacity;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}
.account-section {
  display: none;
}
.account-section.visible {
  display: block;
}
.account-section h4 {
  font-size: 14px;
  color: #5a3320;
  margin-bottom: 8px;
}

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.field-row input[type="text"],
.field-row input[type="email"],
.field-row input[type="password"] {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(107, 76, 55, 0.12);
  background: #fff;
  color: #3b1f0f;
  outline: none;
}
.field-row label {
  min-width: 120px;
  font-weight: 700;
  color: #6a3f1f;
}

.theme-btn {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
}
.theme-btn:hover {
  transform: translateY(-2px);
}

.danger-btn {
  background: linear-gradient(180deg, #c94a4a, #a03232);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
}

.account-card-small {
  font-size: 0.9rem;
  color: #3b1f0f;
}

/* Responsive tweaks */
@media (max-width: 920px) {
  .auth-layout {
    right: 2%;
    width: min(90%, 520px);
  }
  .account-panel {
    width: 100%;
  }
  .account-nav {
    display: none;
  }
}

.google-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 100%);
  color: #4d4032;
  border: 1px solid rgba(108, 85, 62, 0.25);
}

.google-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f3f3f3;
  color: #d14b27;
  font-weight: 700;
}

.google-icon {
  width: 24px;
  height: 24px;
  display: block;
}

@media (max-width: 980px) {
  .auth-layout {
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .auth-layout::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .character {
    display: none;
  }

  .top-navigation {
    left: 14px;
    gap: 14px;
  }

  .nav-btn {
    width: 98px;
    height: 84px;
  }

  .auth-card {
    padding: 24px;
    min-height: auto;
  }

  .wood-sign {
    font-size: 24px;
    padding: 14px 28px;
  }

  .input-row {
    padding: 10px 14px;
  }

  .primary-btn,
  .secondary-btn {
    padding: 14px 18px;
  }
}
