/* =====================================================================
   AZDENT — Modern Clinic  |  style.css
   Design: white bg, #0A1628 dark, #2563EB blue accent, zero gold
   ===================================================================== */

:root {
  --dark:       #0A1628;
  --dark-2:     #111F35;
  --dark-3:     #1C2E48;
  --blue:       #2563EB;
  --blue-light: #3B82F6;
  --blue-dim:   #EFF6FF;
  --bg:         #F4F6FA;
  --surface:    #FFFFFF;
  --border:     #E2E8F0;
  --text:       #0F172A;
  --text-2:     #475569;
  --text-3:     #94A3B8;
  --green:      #10B981;
  --red:        #EF4444;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 3px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.08);
  --shadow-lg:  0 4px 6px rgba(0,0,0,.05), 0 20px 48px rgba(0,0,0,.12);
  --tr:         .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #e8f2fb;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Background — full-page gradient ─────────────────────── */
.az-bg-blur {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Main gradient: dark navy → rich blue → sky → white-blue */
.az-bg-blur::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(168deg,
    #030c1f  0%,
    #071022  8%,
    #0c1c3c  18%,
    #0e2248  28%,
    #122e6a  40%,
    #1b56aa  53%,
    #3a86ce  65%,
    #82bde8  75%,
    #c2def4  84%,
    #ddeefa  91%,
    #e8f2fb  100%
  );
}

/* Dot grid — visible in dark top zone only */
.az-bg-blur::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44%;
  background-image: radial-gradient(circle, rgba(255,255,255,.065) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.65) 0%, transparent 100%);
}

/* Static accent blobs — top zone only, no animation */
.az-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .13;
  pointer-events: none;
}
.az-bg-blob-1 {
  width: 520px; height: 520px;
  background: #3B82F6;
  top: -160px; left: -110px;
}
.az-bg-blob-2 {
  width: 380px; height: 380px;
  background: #818CF8;
  top: -90px; right: -80px;
}
.az-bg-blob-3 {
  width: 260px; height: 260px;
  background: #0EA5E9;
  top: 220px; left: 44%;
  transform: translateX(-50%);
}

/* ── Page ───────────────────────────────────────────────── */
.az-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ── Header ─────────────────────────────────────────────── */
.az-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 40px;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,22,40,.92);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.az-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .95;
}

.az-header-text { display: flex; flex-direction: column; }

.az-clinic-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2.5px;
  line-height: 1.1;
}

.az-clinic-sub {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.az-header-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(37,99,235,.25);
  border: 1px solid rgba(59,130,246,.4);
  color: #93C5FD;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Progress ───────────────────────────────────────────── */
.az-progress-wrap {
  max-width: 800px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.az-progress-bar {
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
  width: 0%;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  margin-bottom: 20px;
  box-shadow: 0 0 12px rgba(37,99,235,.5);
}

.az-steps {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.az-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.35);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3px;
  transition: var(--tr);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.az-step span {
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tr);
}

.az-step.active {
  background: rgba(37,99,235,.2);
  border-color: rgba(59,130,246,.5);
  color: #93C5FD;
}
.az-step.active span {
  background: var(--blue);
  color: #fff;
}

.az-step.done {
  background: rgba(16,185,129,.1);
  border-color: rgba(16,185,129,.3);
  color: #6EE7B7;
}
.az-step.done span {
  background: var(--green);
  color: #fff;
}

/* ── Card ───────────────────────────────────────────────── */
.az-card {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 0 24px;
}

/* ── Step panel ─────────────────────────────────────────── */
.az-step-panel { display: none; }
.az-step-panel.active {
  display: block;
  animation: fadein .3s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── White surface card ─────────────────────────────────── */
.az-surface {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── Panel head ─────────────────────────────────────────── */
.az-panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.az-panel-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.az-panel-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.az-panel-head p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Grid ───────────────────────────────────────────────── */
.az-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Field ──────────────────────────────────────────────── */
.az-field {
  margin-bottom: 18px;
}

.az-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: .1px;
}

.req { color: var(--red); margin-left: 2px; }
.az-opt { color: var(--text-3); font-weight: 400; font-size: 12px; }

/* ── Input wrap ─────────────────────────────────────────── */
.az-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.az-input-wrap > i {
  position: absolute;
  left: 14px;
  color: var(--text-3);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
  transition: color var(--tr);
}

.az-input-wrap input,
.az-input-wrap select,
.az-input-wrap textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.az-input-wrap input:focus,
.az-input-wrap select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.az-input-wrap input:focus ~ i,
.az-input-wrap:focus-within > i {
  color: var(--blue);
}

.az-input-wrap input::placeholder,
.az-input-wrap textarea::placeholder {
  color: var(--text-3);
}

.az-input-wrap select option { background: var(--surface); }

.az-input-wrap.shake {
  animation: shake .35s ease;
  border-color: var(--red);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.az-sub-field { margin-top: 10px; }

/* ── Photo drop ─────────────────────────────────────────── */
.az-photo-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.az-photo-drop:hover,
.az-photo-drop.dragging {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.az-photo-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  padding: 24px;
  text-align: center;
}

.az-photo-drop-inner i { font-size: 28px; color: var(--text-3); }
.az-photo-drop-inner span { font-size: 14px; font-weight: 500; }
.az-photo-drop-inner small { font-size: 12px; }

.az-photo-drop #photoPreviewImg {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.az-photo-drop.has-photo { border-style: solid; border-color: var(--blue); }

/* ── Medical note ───────────────────────────────────────── */
.az-medical-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  border: 1px solid rgba(37,99,235,.2);
  color: #1E40AF;
  font-size: 13px;
  margin-bottom: 20px;
}

.az-medical-note i { margin-top: 2px; flex-shrink: 0; }

/* ── Medical group ──────────────────────────────────────── */
.az-med-group {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--tr);
}

.az-med-group.az-med-open {
  border-color: var(--blue);
}

.az-med-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  gap: 12px;
  cursor: default;
}

.az-med-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.az-med-head-left i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.az-med-radios {
  display: flex;
  gap: 6px;
}

/* ── Radio pills ────────────────────────────────────────── */
.az-radio-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tr);
  user-select: none;
  white-space: nowrap;
}

.az-radio-pill input { display: none; }

.az-radio-pill:hover {
  border-color: #CBD5E1;
  color: var(--text);
  background: #F8FAFC;
}

.az-radio-pill.active[data-val="Bəli"] {
  background: #FEF2F2;
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

.az-radio-pill.active[data-val="Xeyr"] {
  background: #ECFDF5;
  border-color: var(--green);
  color: #059669;
  font-weight: 600;
}

.az-radio-pill.sm {
  padding: 3px 11px;
  font-size: 12px;
}

/* ── Med body ───────────────────────────────────────────── */
.az-med-body {
  border-top: 1px solid var(--border);
  background: #FAFBFE;
  padding: 16px 18px;
}

.az-med-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.az-med-item:last-child { border-bottom: none; }

.az-med-item span {
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
}

.az-med-item-radios { display: flex; gap: 6px; flex-shrink: 0; }

.az-med-custom {
  margin-top: 12px;
}

.az-med-custom .az-input-wrap input {
  height: 40px;
  font-size: 13px;
}

.az-med-week {
  margin-bottom: 14px;
}

.az-med-week label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  display: block;
}

.az-med-week .az-input-wrap input {
  height: 40px;
  font-size: 13px;
}

/* ── Buttons ────────────────────────────────────────────── */
.az-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.az-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  height: 46px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--tr);
  text-decoration: none;
  white-space: nowrap;
}

.az-btn-next,
.az-btn-submit {
  background: var(--blue);
  color: #fff;
}
.az-btn-next:hover,
.az-btn-submit:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37,99,235,.4);
}

.az-btn-back {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: 50px;
}
.az-btn-back:hover {
  background: var(--bg);
  color: var(--text);
  border-color: #CBD5E1;
}

.az-btn-submit {
  background: linear-gradient(135deg, var(--blue), #1D4ED8);
  min-width: 140px;
  justify-content: center;
  border-radius: 50px;
  box-shadow: 0 4px 18px rgba(37,99,235,.35);
}

.az-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

.az-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

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

/* ── Summary (Step 4) ───────────────────────────────────── */
.az-summary-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.az-summary-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.az-summary-row:last-child { border-bottom: none; }

.az-summary-lbl {
  width: 40%;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.az-summary-val {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.az-summary-photo {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 160px;
}

.az-summary-photo img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* ── Consent ────────────────────────────────────────────── */
.az-consent {
  margin: 20px 0 0;
}

.az-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}

.az-checkbox-wrap input { display: none; }

.az-checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--tr);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.az-checkbox-wrap input:checked ~ .az-checkmark {
  background: var(--blue);
  border-color: var(--blue);
}

.az-checkbox-wrap input:checked ~ .az-checkmark::after {
  content: '';
  width: 11px;
  height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

/* ── Toast ──────────────────────────────────────────────── */
.az-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 9999;
  opacity: 0;
  transition: all .35s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  white-space: nowrap;
}

.az-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.az-toast i { color: #FCA5A5; }

/* ── Success screen ─────────────────────────────────────── */
.az-success {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px 24px;
}

.az-success.show { display: flex; }

.az-success-inner {
  background: var(--surface);
  border-radius: 20px;
  padding: 52px 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}

.az-success-anim { margin-bottom: 24px; }

.az-checksvg {
  width: 90px;
  height: 90px;
}

.az-check-circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-dasharray: 290;
  stroke-dashoffset: 290;
  animation: drawCircle .6s ease forwards .1s;
}

.az-check-mark {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck .4s ease forwards .65s;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.az-success-inner h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.az-success-inner p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.az-success-id {
  display: inline-block;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid rgba(37,99,235,.2);
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.az-success-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.az-success-brand img {
  height: 24px;
  object-fit: contain;
  opacity: .6;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .az-header { padding: 0 18px; }
  .az-header-badge { display: none; }
  .az-progress-wrap, .az-card { padding: 0 14px; }
  .az-surface { padding: 24px 20px; }
  .az-grid-2 { grid-template-columns: 1fr; }
  .az-step { font-size: 11px; padding: 6px 12px; }
  .az-success-inner { padding: 36px 24px; }
}
