/* =========================================================
   Rahul Panda — Appointment Booking (PHP + MySQL)
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --blue: #1d4ed8;
    --blue-dark: #1e3a8a;
    --blue-light: #eff6ff;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #d97706;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
    --shadow: 0 6px 24px rgba(15,23,42,0.08);
    --shadow-lg: 0 16px 48px rgba(15,23,42,0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }
h1 { font-size: 2.3rem; letter-spacing: -0.02em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.1rem; }
a { color: var(--blue); text-decoration: none; }
code { font-family: "Courier New", monospace; font-size: 0.85em; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 11px 20px; font-size: 0.95rem; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all 0.2s ease;
    white-space: nowrap; text-align: center; text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); border-color: #cbd5e1; }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; color: var(--ink); }
.brand-text small { font-size: 0.72rem; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: 0.92rem; transition: color 0.2s; }
.site-nav a:hover { color: var(--blue); }
.site-nav a.btn { color: #fff; }

/* Hero */
.hero { background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); padding: 80px 0 70px; border-bottom: 1px solid var(--line); }
.hero-inner { text-align: center; max-width: 780px; margin: 0 auto; }
.pill {
    display: inline-block; background: var(--blue-light); color: var(--blue-dark);
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
    padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; text-transform: uppercase;
}
.hero h1 { margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: var(--blue-dark); font-weight: 600; margin-bottom: 14px; }
.hero-desc { font-size: 1.05rem; color: var(--muted); max-width: 600px; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.hero-meta { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; padding-top: 30px; border-top: 1px solid var(--line); }
.hero-meta div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-meta strong { color: var(--ink); font-size: 1rem; }
.hero-meta span { font-size: 0.82rem; color: var(--muted); }

.section { padding: 70px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head p { color: var(--muted); margin-top: 8px; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.type-card { text-align: center; }
.type-card .icon {
    width: 54px; height: 54px; border-radius: 14px;
    background: var(--blue-light); color: var(--blue-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 16px;
}
.type-card h3 { margin-bottom: 8px; }
.type-card p { font-size: 0.9rem; color: var(--muted); }
.step-card { text-align: center; }
.step-num {
    display: inline-block; font-size: 0.85rem; font-weight: 800;
    color: var(--blue); background: var(--blue-light);
    padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; letter-spacing: 0.05em;
}
.step-card p { font-size: 0.9rem; color: var(--muted); }
.center-cta { text-align: center; margin-top: 44px; }
.about-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 34px; box-shadow: var(--shadow-sm); max-width: 860px; margin: 0 auto;
}
.about-card p { margin-bottom: 14px; }
.about-card p:last-child { margin-bottom: 0; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea, select {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
input.invalid, textarea.invalid { border-color: var(--red); }
textarea { resize: vertical; min-height: 100px; }
.char-count { font-size: 0.78rem; color: var(--muted); text-align: right; }
.error { font-size: 0.8rem; color: var(--red); min-height: 0; display: block; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.92rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* Booking */
.booking-wrap { padding: 50px 0 70px; background: var(--bg-alt); min-height: 70vh; }
.booking-header { text-align: center; margin-bottom: 34px; }
.booking-header p { color: var(--muted); margin-top: 8px; }

.progress { display: flex; align-items: center; justify-content: center; margin: 0 auto 34px; max-width: 720px; }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.progress-step .dot {
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 2px solid var(--line); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; transition: all 0.25s;
}
.progress-step .label { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-align: center; }
.progress-step.active .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.progress-step.active .label { color: var(--blue-dark); }
.progress-step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.progress-step.done .label { color: var(--green); }
.progress-line { flex: 1; height: 2px; background: var(--line); margin: 0 8px; margin-bottom: 22px; }

.step-panel { animation: fadeIn 0.3s ease; }
.step-panel.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card-title { font-size: 1.25rem; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Date & Time grid */
.datetime-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; }

/* Calendar */
.calendar-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-weight: 700; color: var(--ink); font-size: 1rem; }
.cal-nav {
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; cursor: pointer;
    font-size: 1.2rem; color: var(--text); display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.cal-nav:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.calendar-weekdays span { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
    aspect-ratio: 1 / 1; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; font-weight: 500; color: var(--text);
    background: #fff; border: 1px solid transparent; cursor: pointer;
    transition: all 0.15s; user-select: none;
}
.cal-day.empty { visibility: hidden; cursor: default; }
.cal-day.available:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); }
.cal-day.today { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.cal-day.selected { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; box-shadow: var(--shadow-sm); }
.cal-day.unavailable { color: #cbd5e1; background: #f8fafc; cursor: not-allowed; text-decoration: line-through; }
.cal-day.disabled { color: #cbd5e1; cursor: not-allowed; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-avail { background: #fff; border: 2px solid var(--blue); }
.dot-unavail { background: #e2e8f0; }
.dot-today { background: #fff; border: 2px solid var(--blue); }
.dot-selected { background: var(--blue); }

/* Time slots */
.slots-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.slots-box h3 { margin-bottom: 6px; }
.slots-hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.slots-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.slot {
    padding: 12px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: #fff; cursor: pointer;
    font-size: 0.88rem; font-weight: 600; color: var(--ink);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    transition: all 0.18s; font-family: inherit;
}
.slot small { font-size: 0.68rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: 0.03em; }
.slot:hover:not(.booked) { border-color: var(--blue); background: var(--blue-light); color: var(--blue-dark); transform: translateY(-1px); }
.slot.selected { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: var(--shadow-sm); }
.slot.selected small { color: #dbeafe; }
.slot.booked { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; border-color: var(--line); }
.slot.booked small { color: var(--red); }
.slot.empty-msg { grid-column: 1 / -1; text-align: center; color: var(--muted); font-weight: 500; padding: 24px; border: 1px dashed var(--line); }

/* Summary */
.sub-title { font-size: 1rem; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.summary-grid.single-col { grid-template-columns: 1fr; }
.summary-item { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.summary-item:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-item:nth-last-child(-n+2) { border-bottom: none; }
.summary-grid.single-col .summary-item { border-right: none; }
.summary-grid.single-col .summary-item:not(:last-child) { border-bottom: 1px solid var(--line); }
.summary-item span { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.summary-item strong { color: var(--ink); font-size: 0.95rem; word-break: break-word; }
.status-good { color: var(--green) !important; }

/* Disclaimer */
.disclaimer { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.disclaimer h3 { color: var(--amber); font-size: 1rem; margin-bottom: 10px; }
.disclaimer p { font-size: 0.88rem; color: #78350f; margin-bottom: 8px; }
.disclaimer p:last-child { margin-bottom: 0; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 16px; background: var(--bg-alt); border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: pointer; font-size: 0.92rem; margin-bottom: 4px; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); cursor: pointer; }

/* Success / verify cards */
.success-card, .verify-card { max-width: 720px; margin: 0 auto; text-align: center; padding: 40px; }
.success-card h1, .verify-card h1 { font-size: 1.6rem; margin: 12px 0 8px; }
.success-icon, .verify-icon {
    width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff; font-weight: 700;
}
.success-icon, .verify-ok { background: var(--green); }
.verify-warn { background: var(--amber); }
.verify-bad { background: var(--red); }
.success-card .summary-grid, .verify-card .summary-grid { text-align: left; margin: 24px 0; }

/* Receipt */
.receipt-wrap { padding: 44px 0 70px; background: var(--bg-alt); min-height: 70vh; }
.receipt-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.receipt-actions > div { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 860px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.receipt-head h1 { font-size: 1.8rem; }
.receipt-head p { color: var(--muted); font-size: 0.9rem; }
.receipt-badge { background: var(--blue-light); color: var(--blue-dark); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; padding: 8px 14px; border-radius: 8px; text-transform: uppercase; }
.receipt-divider { height: 1px; background: var(--line); margin: 24px 0; }
.receipt-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.receipt-id-block { display: flex; flex-direction: column; gap: 6px; }
.receipt-label { font-size: 0.75rem; color: var(--muted); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.receipt-id-block strong { font-size: 1.5rem; color: var(--ink); font-family: "Courier New", monospace; letter-spacing: 0.02em; }
.receipt-status { display: inline-block; background: #dcfce7; color: #166534; font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; width: fit-content; margin-top: 4px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-image { width: 140px; height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.qr-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-align: center; }
.receipt-details { display: flex; flex-direction: column; }
.r-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.r-row:last-child { border-bottom: none; }
.r-row span { color: var(--muted); font-weight: 500; flex: 0 0 auto; }
.r-row strong { color: var(--ink); text-align: right; word-break: break-word; }
.receipt-note { background: var(--bg-alt); border-radius: var(--radius-sm); padding: 18px; }
.receipt-note p { font-size: 0.92rem; margin-bottom: 10px; }
.receipt-note p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem !important; }

/* Manage / Reschedule / Cancel */
.manage-card { max-width: 720px; margin: 0 auto; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 10px;
    font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 200;
    max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* Footer */
.site-footer { background: var(--ink); color: #cbd5e1; padding: 44px 0 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid #1e293b; }
.footer-inner strong { color: #fff; font-size: 1.05rem; }
.footer-inner p { color: #94a3b8; font-size: 0.88rem; margin-top: 4px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: #cbd5e1; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding: 18px 20px; text-align: center; }
.footer-bottom p { color: #64748b; font-size: 0.82rem; }

/* Responsive */
@media (max-width: 960px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .datetime-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .site-nav { gap: 14px; }
    .site-nav a:not(.btn) { display: none; }
    .hero { padding: 56px 0 48px; }
    .hero-meta { gap: 28px; }
    .section { padding: 52px 0; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-item:nth-child(odd) { border-right: none; }
    .summary-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .summary-item:last-child { border-bottom: none; }
    .receipt { padding: 24px; }
    .receipt-head { flex-direction: column; }
    .receipt-top { flex-direction: column; }
    .r-row { flex-direction: column; gap: 3px; }
    .r-row strong { text-align: left; }
    .step-actions { flex-direction: column-reverse; }
    .step-actions .btn { width: 100%; }
    .progress-step .label { font-size: 0.7rem; }
    .receipt-actions { flex-direction: column; align-items: stretch; }
    .receipt-actions .btn { width: 100%; }
    .receipt-actions > div { flex-direction: column; }
    .slots-grid { grid-template-columns: repeat(2, 1fr); }
    .booking-wrap { padding: 34px 0 54px; }
}
@media (max-width: 420px) {
    .container { padding: 0 16px; }
    h1 { font-size: 1.7rem; }
    .hero-actions .btn { width: 100%; }
    .slots-grid { grid-template-columns: 1fr; }
    .calendar-box, .slots-box { padding: 14px; }
}

/* Print */
@media print {
    .no-print, .site-header, .site-footer, .receipt-actions, .toast { display: none !important; }
    body { background: #fff; }
    .receipt-wrap { padding: 0; background: #fff; }
    .receipt { box-shadow: none; border: 1px solid #000; max-width: 100%; padding: 24px; }
    .receipt-badge { border: 1px solid var(--blue-dark); }
    .qr-image { border: 1px solid #000; }
}