@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

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

/* ── Root Tokens ── */
:root {
  --primary:       #16A34A;
  --primary-dark:  #15803D;
  --primary-soft:  #DCFCE7;
  --bg:            #F0F2F5;
  --surface:       #FFFFFF;
  --text:          #111827;
  --text-muted:    #6B7280;
  --border:        #E5E7EB;
  --danger:        #EF4444;
  --danger-bg:     #FEF2F2;
  --danger-border: #FECACA;
  --radius-card:   22px;
  --radius-input:  14px;
  --radius-btn:    14px;
}

/* ── Base ── */
html, body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

input, button, a { font-family: inherit; }
input { outline: none; }
input::placeholder { color: #C4C9D4; }
a { text-decoration: none; }

/* ── Layout ── */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 52px 24px 80px;
  position: relative;
  overflow: hidden;
}

.header__circle-1 {
  position: absolute;
  top: -60px; left: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.header__circle-2 {
  position: absolute;
  bottom: -30px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.logo__mark {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.logo__mark svg { display: block; }

.logo__name {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}

.header__title-block {
  margin-top: 28px;
  position: relative;
}

.header__title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
  transition: opacity .2s;
}

.header__sub {
  font-size: 14.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  transition: opacity .2s;
}

/* ── Card ── */
.card-wrap {
  flex: 1;
  padding: 0 16px 32px;
  margin-top: -32px;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 30px 24px 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  animation: slideUp .4s cubic-bezier(.22,1,.36,1);
}

/* ── Steps ── */
.step { animation: fadeIn .25s ease; }
.step--hidden { display: none !important; }

/* ── Label ── */
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

/* ── Input Field ── */
.field {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  transition: border-color .18s;
  overflow: hidden;
}

.field:focus-within { border-color: var(--primary); }
.field--error { border-color: var(--danger) !important; }

.field__icon {
  padding: 0 14px;
  font-size: 18px;
  color: #9CA3AF;
  line-height: 1;
  flex-shrink: 0;
  transition: color .18s;
  pointer-events: none;
}

.field:focus-within .field__icon { color: var(--primary); }

.field__input {
  flex: 1;
  height: 54px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
}

.field__input--phone {
  direction: ltr;
  text-align: right;
  letter-spacing: 1.2px;
  padding-left: 14px;
}

select.field__input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 34px;
}

.reg-hint {
  margin: 10px 2px 14px;
  font-size: 12px;
  line-height: 1.9;
  color: #6b7280;
  background: #f4f7f5;
  border: 1px solid #e5ece8;
  border-radius: 10px;
  padding: 8px 10px;
}

.field__input--password {
  direction: rtl;
  padding-left: 0;
}

.field__toggle {
  background: none;
  border: none;
  padding: 0 14px;
  color: #9CA3AF;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color .15s;
}

.field__toggle:hover { color: #6B7280; }

/* ── Error message ── */
.error-msg {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 10px;
}

.error-msg--visible { display: flex; }

/* ── Checkbox ── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  cursor: pointer;
  user-select: none;
}

.checkbox-box {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}

.checkbox-box--checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  height: 54px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  transition: background .15s, transform .1s;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .82; cursor: not-allowed; }

.btn-ghost {
  width: 100%;
  height: 44px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  transition: border-color .15s, color .15s;
}

.btn-ghost:hover { border-color: #D1D5DB; color: #374151; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bspin .7s linear infinite;
  flex-shrink: 0;
}

/* ── Forgot password link ── */
.forgot-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
}

.forgot-link:hover { color: var(--primary-dark); }

/* ── Success ── */
.success-block {
  text-align: center;
  padding: 12px 0 20px;
}

.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  animation: popIn .4s cubic-bezier(.175,.885,.32,1.275);
}

.success-icon i { font-size: 36px; color: var(--primary); }

.success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.success-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Footer note ── */
.footer-note {
  text-align: center;
  font-size: 12.5px;
  color: #9CA3AF;
  margin-top: 20px;
  line-height: 1.8;
}

.footer-note a {
  color: var(--primary);
  font-weight: 600;
}

/* ── Animations ── */
@keyframes bspin   { to { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes popIn   { from { opacity:0; transform:scale(.5); } to { opacity:1; transform:scale(1); } }
