@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --primary: #1397f5;
  --primary-dark: #0874d1;
  --text: #172033;
  --muted: #707789;
  --line: #e2edf7;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 80% 8%, rgba(77, 163, 255, 0.17), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #f3f9ff 100%);
}

button, input { font: inherit; font-size: 16px; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(28, 82, 142, 0.13);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(19, 151, 245, 0.22);
}

.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 21px; font-weight: 900; }
.brand small { color: var(--muted); font-size: 11px; }

h1 {
  margin: 28px 0 8px;
  font-size: 30px;
  line-height: 1.4;
}

p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.9;
}

form { display: grid; gap: 10px; }

label {
  margin-top: 4px;
  color: var(--text);
  font-weight: 800;
}

label small, .field-help {
  color: var(--muted);
  font-weight: 400;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d6e4f0;
  border-radius: 14px;
  padding: 0 15px;
  background: #fff;
  color: var(--text);
}

input[type="email"], #code { direction: ltr; text-align: left; }
#code { text-align: center; letter-spacing: 4px; font-family: Arial, sans-serif; font-size: 22px; font-weight: 800; }

input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.17);
}

button {
  min-height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #1aa5ff 0%, #078cf1 100%);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(19, 151, 245, 0.23);
}

button:disabled { cursor: wait; opacity: 0.65; }
.hidden { display: none; }

#codeField { display: grid; gap: 9px; margin-top: 5px; }
#codeField.hidden { display: none; }

.status {
  min-height: 28px;
  margin: 16px 0 0;
  color: var(--primary-dark);
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 520px) {
  .auth-shell { place-items: stretch; align-content: start; padding-inline: 12px; }
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  h1 { font-size: 26px; }
}
