@font-face {
  font-family: "FSerifCondensed-Medium";
  src: url("/fonts/FSerifCondensed-Medium.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Gilroy-SemiBold";
  src: url("/fonts/Gilroy-SemiBold.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Gilroy-Medium";
  src: url("/fonts/Gilroy-Medium.woff2") format("woff2");
  font-display: swap;
}

:root {
  --page-bg: #ebe8e2;
  --page-bg-strong: #e3dfd8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-soft: #f5f3ef;
  --surface-softer: #f1efea;
  --text-strong: #161616;
  --text-muted: #767068;
  --text-faint: #9f988f;
  --border-soft: rgba(22, 22, 22, 0.08);
  --border-strong: rgba(22, 22, 22, 0.14);
  --shadow-card: 0 38px 80px rgba(16, 16, 16, 0.09);
  --shadow-soft: 0 14px 28px rgba(16, 16, 16, 0.07);
  --radius-shell: 30px;
  --radius-panel: 24px;
  --radius-field: 18px;
  --radius-pill: 999px;
  --max-width: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Gilroy-SemiBold", system-ui, sans-serif;
  color: var(--text-strong);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.42), transparent 22%),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-strong) 100%);
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.screen {
  position: relative;
  min-height: 100vh;
  padding: clamp(16px, 3vw, 32px);
  overflow: hidden;
}

.screen::before,
.screen::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.85;
  pointer-events: none;
}

.screen::before {
  top: -120px;
  right: min(6vw, 72px);
  width: clamp(240px, 30vw, 420px);
  height: clamp(240px, 30vw, 420px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 72%);
}

.screen::after {
  bottom: -180px;
  left: -40px;
  width: clamp(220px, 28vw, 360px);
  height: clamp(220px, 28vw, 360px);
  background: radial-gradient(circle, rgba(220, 214, 204, 0.9) 0%, rgba(220, 214, 204, 0) 74%);
}

.auth-stage,
.dashboard-stage,
.loading-stage {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  min-height: calc(100vh - clamp(32px, 6vw, 64px));
  display: flex;
  flex-direction: column;
}

.auth-card,
.dashboard-card,
.loading-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-card {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: clamp(24px, 4vw, 42px);
  padding: clamp(18px, 2.4vw, 30px);
  border-radius: var(--radius-shell);
  animation: rise 0.55s ease both;
}

.auth-media {
  min-height: clamp(420px, 74vh, 760px);
  border-radius: 22px;
  overflow: hidden;
  background: #d8d1c9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.auth-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 22px);
}

.auth-panel__inner {
  width: min(100%, 390px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-logo {
  width: 74px;
  height: auto;
}

.auth-title {
  margin: 32px 0 14px;
  font-family: "FSerifCondensed-Medium", Georgia, serif;
  font-size: clamp(3.3rem, 6vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.auth-subtitle {
  margin: 0 0 30px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 25rem;
}

.verify-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: -8px 0 24px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.3;
  box-shadow: inset 0 0 0 1px rgba(22, 22, 22, 0.04);
}

.verify-email span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.field-group--full {
  grid-column: 1 / -1;
}

.field-label {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.field {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-field);
  background: var(--surface-soft);
  color: var(--text-strong);
  font-size: 0.97rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field::placeholder {
  color: var(--text-faint);
}

.field:hover,
.code-input:hover {
  background: #efede9;
}

.field:focus {
  outline: none;
  border-color: rgba(22, 22, 22, 0.1);
  box-shadow: 0 0 0 4px rgba(22, 22, 22, 0.05);
}

.phone-field {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-field);
  background: var(--surface-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.phone-field:hover {
  background: #efede9;
}

.phone-field:focus-within {
  border-color: rgba(22, 22, 22, 0.1);
  box-shadow: 0 0 0 4px rgba(22, 22, 22, 0.05);
}

.phone-field__prefix {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 0.96rem;
}

.phone-field__input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 0 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: 0.97rem;
}

.phone-field__input::placeholder {
  color: var(--text-faint);
}

.phone-field__input:focus {
  outline: none;
}

.primary-button,
.secondary-button,
.logout-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 16px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.16);
}

.primary-button:hover:enabled,
.secondary-button:hover:enabled {
  transform: translateY(-1px);
}

.primary-button:hover:enabled {
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.2);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.9;
}

.button__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.primary-button.is-loading .button__spinner {
  display: inline-block;
}

.form-feedback {
  min-height: 1.35rem;
  margin: 2px 0 0;
  color: #c15037;
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-feedback.is-success {
  color: #3f7150;
}

.verify-code-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.code-input {
  width: 100%;
  height: 74px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--surface-soft);
  color: var(--text-strong);
  text-align: center;
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.code-input:focus {
  outline: none;
  border-color: rgba(22, 22, 22, 0.1);
  box-shadow: 0 0 0 4px rgba(22, 22, 22, 0.05);
  transform: translateY(-1px);
}

.helper-copy {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.app-footer {
  padding: 20px 12px 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.loading-card {
  width: min(100%, 520px);
  margin: auto;
  padding: 40px 34px;
  border-radius: 28px;
  text-align: center;
  animation: rise 0.45s ease both;
}

.loading-card__spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #111111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-card__title {
  margin: 0 0 10px;
  font-family: "FSerifCondensed-Medium", Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 3.3rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.loading-card__copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.dashboard-card {
  flex: 1;
  border-radius: var(--radius-shell);
  padding: clamp(20px, 2.6vw, 34px);
  display: flex;
  flex-direction: column;
  animation: rise 0.55s ease both;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.dashboard-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dashboard-brand img {
  width: 34px;
  height: auto;
}

.dashboard-brand span {
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 0.98rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 0;
}

.user-email {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.logout-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 0.78rem;
}

.logout-button:hover {
  color: var(--text-strong);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 1rem;
}

.dashboard-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(48px, 9vh, 120px) 12px;
}

.dashboard-hero {
  width: min(100%, 680px);
  text-align: center;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.dashboard-title {
  margin: 0 0 16px;
  font-family: "FSerifCondensed-Medium", Georgia, serif;
  font-size: clamp(3.2rem, 7vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.dashboard-copy {
  width: min(100%, 34rem);
  margin: 0 auto 30px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-solid);
  color: var(--text-strong);
  cursor: pointer;
  font-family: "Gilroy-Medium", system-ui, sans-serif;
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
}

.secondary-button:hover:enabled {
  border-color: rgba(22, 22, 22, 0.24);
  box-shadow: 0 18px 34px rgba(16, 16, 16, 0.08);
}

.plus-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.coming-soon-card {
  margin-top: 16px;
  padding: 24px 24px 26px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(246, 244, 240, 0.9), rgba(255, 255, 255, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.coming-soon-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

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

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-media {
    min-height: 320px;
  }

  .auth-panel {
    padding: 10px 6px 6px;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .user-pill {
    justify-content: space-between;
  }

  .user-meta {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 14px;
  }

  .auth-card,
  .dashboard-card,
  .loading-card {
    border-radius: 24px;
  }

  .auth-card,
  .dashboard-card {
    padding: 16px;
  }

  .auth-title,
  .dashboard-title {
    letter-spacing: -0.045em;
  }

  .verify-code-grid {
    gap: 10px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .field-group--full {
    grid-column: auto;
  }

  .code-input {
    height: 64px;
    border-radius: 20px;
    font-size: 1.7rem;
  }

  .user-email {
    max-width: 180px;
  }
}
