/* ═══════════════════════════════════════════
   Ta'lim Granti Portali — Asosiy stil fayli
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --green:        #116E63;   /* sayt asosiy rangi */
  --green-light:  #ddefec;
  --green-dark:   #0a4a41;
  --blue:         #116E63;
  --blue-light:   #ddefec;
  --amber:        #c97f0a;   /* sayt ikkinchi rangi (#FDA31B) asosida */
  --amber-light:  #fef3c7;
  --red:          #b91c1c;
  --red-light:    #fee2e2;
  --bg:           #f4f6f4;
  --surface:      #ffffff;
  --surface2:     #f0f2f0;
  --border:       #d8ddd8;
  --border-dark:  #b0b8b0;
  --text:         #1a1f1a;
  --text-muted:   #5a6a5a;
  --text-light:   #8a9a8a;
  --radius:       6px;
  --radius-lg:    10px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:    0 4px 16px rgba(0,0,0,.10);
}

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

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { width: 42px; height: 42px; object-fit: contain; }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 15px; font-weight: 600; color: var(--text); }
.logo-text span   { font-size: 11px; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; }

.header-right { display: flex; align-items: center; gap: 16px; }

.deadline-badge {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid #fcd34d;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
}

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
}
.nav-links a:hover   { background: var(--surface2); color: var(--text); }
.nav-links a.active  { background: var(--green); color: white; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #1a8f80 100%);
  color: white;
  padding: 40px 32px 36px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.06); border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute;
  bottom: -60px; left: 30%;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.04); border-radius: 50%;
}
.hero-inner { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: 26px; font-weight: 600; letter-spacing: -.3px; margin-bottom: 6px; }
.hero p  { font-size: 14px; opacity: .82; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.hero-stat {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.hero-stat .num {
  font-size: 22px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  display: block;
}
.hero-stat .lbl { font-size: 11px; opacity: .75; margin-top: 2px; }

/* ── SERVICE CARDS (index) ── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 32px auto;
  padding: 0 24px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all .2s;
  display: flex; flex-direction: column; gap: 12px;
}
.service-card:hover { border-color: var(--green); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.service-card .sc-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.sc-green  { background: var(--green-light); }
.sc-amber  { background: var(--amber-light); }
.sc-blue   { background: var(--blue-light); }
.service-card h3 { font-size: 16px; font-weight: 600; }
.service-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.service-card .sc-arrow { color: var(--green); font-size: 18px; margin-top: auto; }

/* ── MAIN WRAPPER ── */
.main { max-width: 780px; margin: 0 auto; padding: 32px 24px 60px; }

/* ── STEPS ── */
.steps-bar {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.step-item {
  flex: 1;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-light);
  display: flex; align-items: center; gap: 8px;
  border-right: 1px solid var(--border);
}
.step-item:last-child { border-right: none; }
.step-item.done   { color: var(--green); }
.step-item.active { color: var(--text); font-weight: 500; }
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.step-item.done   .step-num { background: var(--green); color: white; }
.step-item.active .step-num { background: var(--text);  color: white; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

.card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.ci-green  { background: var(--green-light); }
.ci-blue   { background: var(--blue-light); }
.ci-amber  { background: var(--amber-light); }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── FORM ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.field label .req { color: var(--red); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none; width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,122,80,.12);
}
.field textarea { resize: vertical; min-height: 100px; }
.field-hint { font-size: 11px; color: var(--text-light); }

.field ul.errorlist {
  list-style: none; margin: 4px 0 0;
}
.field ul.errorlist li {
  font-size: 12px; color: var(--red);
}

/* ── FILE INPUT ── */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
  position: relative;
}
.file-drop:hover { border-color: var(--green); }
.file-drop input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop .fd-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.file-drop p { font-size: 13px; color: var(--text-muted); }

/* ── ALERT ── */
.alert {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px; line-height: 1.5;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-amber { background: var(--amber-light); border: 1px solid #fcd34d; color: var(--amber); }
.alert-blue  { background: var(--blue-light);  border: 1px solid #93c5fd; color: var(--blue); }
.alert-green { background: var(--green-light); border: 1px solid #6ee7b7; color: var(--green-dark); }
.alert-red   { background: var(--red-light);   border: 1px solid #fca5a5; color: var(--red); }

/* ── BUTTONS ── */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.btn-primary   { background: var(--green); color: white; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-dark); }
.btn-secondary:hover { background: var(--surface2); }
.btn-lg   { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.form-actions {
  display: flex; gap: 12px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── STATUS TABLE ── */
.status-table { width: 100%; border-collapse: collapse; }
.status-table tr { border-bottom: 1px solid var(--border); }
.status-table tr:last-child { border-bottom: none; }
.status-table td { padding: 11px 0; font-size: 14px; vertical-align: middle; }
.status-table td:first-child { color: var(--text-muted); width: 44%; font-size: 13px; }
.status-table td:last-child  { font-weight: 500; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-success { background: var(--green-light); color: var(--green-dark); }
.badge-warn    { background: var(--amber-light); color: var(--amber); }
.badge-info    { background: var(--blue-light);  color: var(--blue); }
.badge-danger  { background: var(--red-light);   color: var(--red); }

/* ── SUCCESS PAGE ── */
.success-box {
  text-align: center;
  padding: 48px 32px;
  max-width: 480px;
  margin: 40px auto;
}
.success-icon { font-size: 60px; display: block; margin-bottom: 16px; }
.success-box h2 { font-size: 22px; font-weight: 600; margin-bottom: 10px; }
.success-box p  { color: var(--text-muted); margin-bottom: 20px; }
.ref-num {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 20px; font-weight: 500;
  letter-spacing: .05em;
  display: inline-block;
  margin-bottom: 24px;
}

/* ── HOLAT SEARCH ── */
.search-bar {
  display: flex; gap: 10px;
  margin-bottom: 24px;
}
.search-bar input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  outline: none; transition: border-color .15s;
}
.search-bar input:focus { border-color: var(--green); }

/* ── FOOTER ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 60px;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 16px; }
  .main { padding: 20px 16px 40px; }
  .site-header { padding: 0 16px; }
  .hero-stats { gap: 12px; }
  .hero h1 { font-size: 20px; }
  .deadline-badge { display: none; }
  .service-grid { grid-template-columns: 1fr; }
  .nav-links a span { display: none; }
}

/* ══════════════════════════════════════════
   AUTH TIZIMI STILLARI
   ══════════════════════════════════════════ */

/* Header auth buttons */
.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.auth-login-btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .15s;
}
.auth-login-btn:hover { background: var(--surface2); color: var(--text); }

.auth-register-btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  background: var(--green);
  color: white;
  transition: all .15s;
}
.auth-register-btn:hover { background: var(--green-dark); }

.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all .15s;
  max-width: 200px;
}
.auth-user-btn:hover { background: var(--surface2); }

.auth-avatar {
  width: 28px;
  height: 28px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.auth-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-logout-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 16px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .15s;
}
.auth-logout-btn:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* Auth card (login, register, forgot, reset) */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
  min-height: calc(100vh - 200px);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.auth-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-links a {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }

/* Buttons */
.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-full { width: 100%; justify-content: center; }

/* Form groups */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(17, 110, 99, .12);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--red);
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}

/* Alert variants */
.alert { display:flex; align-items:flex-start; gap:10px; padding:12px 16px; border-radius:var(--radius); font-size:13px; }
.alert-success  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error,
.alert-danger   { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }
.alert-warning  { background: var(--amber-light); color: var(--amber); border: 1px solid #fcd34d; }
.alert-blue,
.alert-info     { background: var(--blue-light); color: #0f5340; border: 1px solid #6ee7d4; }

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-red    { background: var(--red-light); color: var(--red); }

.btn-link-sm {
  font-size: 12px;
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.btn-link-sm:hover { text-decoration: underline; }
