@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Inter-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Inter-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Inter-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Inter-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/Inter-800.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('fonts/Inter-900.ttf') format('truetype');
}

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

:root {
  --brand: #E8192C;
  --btn-bg: #4A6587;
  --btn-hover: #3d5472;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-hint: #888;
  --input-bg: #F2F2F7;
  --input-border: #E0E0E5;
  --error: #E8192C;
  --info-bg: #FFF3CD;
  --info-border: #FFC107;
  --info-text: #856404;
  --white: #ffffff;
  --radius-input: 12px;
  --radius-btn: 50px;
  --radius-card: 0px;
}

html, body {
  height: 100%;
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
}

body {
  min-height: 100vh;
  padding: 0;
}

.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 0;
  margin: 0 auto;
}

.screen.active {
  display: block;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  gap: 0;
}

/* BRAND */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 10px;
}

.brand-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.3px;
}

/* HINTS */
.hint {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.info-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 4px;
}

/* AUTH TABS */
.auth-tabs {
  display: flex;
  gap: 3px;
  background: var(--input-bg);
  border-radius: 10px;
  padding: 4px;
  width: 100%;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  font-family: inherit;
}
.auth-tab.active {
  background: var(--white);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* INPUT */
.field-wrap {
  width: 100%;
  margin-bottom: 16px;
}

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-input);
  padding: 15px 16px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-hint);
}

.input:focus {
  border-color: var(--btn-bg);
  background: var(--white);
}

.input.error {
  border-color: var(--error);
  background: #FFF5F5;
}

/* FIELD ERROR */
.field-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  padding-left: 4px;
}

/* INFO / ERROR BLOCKS */
.info-block {
  width: 100%;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--info-text);
  text-align: center;
  margin-bottom: 16px;
}

.error-block {
  width: 100%;
  background: #FFF5F5;
  border: 1px solid #FFCDD2;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--error);
  text-align: center;
  margin-bottom: 16px;
}

/* BUTTONS */
.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--white);
  margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  color: var(--btn-bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* OTP CELLS */
.otp-fields {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.otp-cell {
  width: 64px;
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  outline: none;
  caret-color: transparent;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.otp-cell:focus {
  border-color: var(--btn-bg);
  background: var(--white);
}

.otp-cell.error {
  border-color: var(--error);
  background: #FFF5F5;
  color: var(--error);
}

/* RESEND */
.resend-block {
  margin-top: 16px;
  text-align: center;
  min-height: 28px;
}

.resend-timer {
  font-size: 14px;
  color: var(--text-hint);
}

/* SPINNER */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* BACK BUTTON */
.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--brand);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 0 16px 0;
  margin: 0;
  align-self: flex-start;
}
.btn-back:active { opacity: 0.6; }

/* RESULT SCREENS */
.result-icon {
  font-size: 56px;
  margin: 8px 0 12px;
  line-height: 1;
}

.result-icon--success { color: #34C759; }
.result-icon--fail    { color: var(--error); }

.result-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
}

/* CONFIRM LINK */
.confirm-link {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
  transition: background 0.2s;
}
.confirm-link:hover { background: var(--btn-hover); }

/* CONSENT TEXT */
.consent-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.consent-link {
  color: var(--brand);
  text-decoration: none;
}
.consent-link:hover { text-decoration: underline; }

/* UTILS */
.hidden {
  display: none !important;
}

@media (max-width: 400px) {
  .otp-cell {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  .card {
    padding: 36px 16px 32px;
  }
}

/* ── SPA SCREEN OVERRIDES ── */
/* Landing screen takes full width, no max-width cap */
#screen-landing.active {
  max-width: none;
}

/* Privacy screen takes full width, no max-width cap */
#screen-privacy.active {
  max-width: none;
}
