:root {
    --brand-primary: #0c3a5b; /* from logo */
    --brand-secondary: #99999a; /* from logo */
    --bg: #f6f8fb;
    --text: #0b1f33;
    --muted: #5b6b7a;
    --card: #ffffff;
    --accent: #1aa3b0;
    --ring: rgba(26,163,176,0.35);
    --shadow: 0 10px 30px rgba(12,58,91,0.12), 0 6px 12px rgba(12,58,91,0.08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(12,58,91,0.08), transparent 60%),
        radial-gradient(1000px 500px at -10% 110%, rgba(26,163,176,0.10), transparent 60%),
        var(--bg);
    display: grid;
    place-items: center;
    padding: 24px;
}

.page {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: center;
}

@media (min-width: 900px) {
    .page { grid-template-columns: 1.1fr 0.9fr; gap: 40px; }
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand img { height: 36px; }
.brand span {
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: .2px;
}

.hero { display: grid; gap: 16px; }
.title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    margin: 0;
    color: var(--brand-primary);
}
.subtitle {
    font-size: clamp(14px, 1.9vw, 18px);
    color: var(--muted);
    margin: 0;
}

.card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.9));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3.5vw, 28px);
    overflow: visible;
}

/* Chat-like decorative bubbles */
.card::before,
.card::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 20px;
    opacity: .55;
}
.card::before {
    width: 140px; height: 42px;
    left: -24px; top: 24px;
    background: linear-gradient(90deg, rgba(12,58,91,0.12), rgba(26,163,176,0.12));
    transform: rotate(-6deg);
    filter: blur(0.3px);
}
.card::after {
    width: 180px; height: 48px;
    right: -28px; bottom: 26px;
    background: linear-gradient(90deg, rgba(26,163,176,0.16), rgba(12,58,91,0.12));
    transform: rotate(6deg);
    filter: blur(0.4px);
}

form { position: relative; z-index: 1; display: grid; gap: 14px; }

.fieldset { display: grid; gap: 12px; }

.field { display: grid; gap: 8px; }
label { font-size: 14px; color: var(--muted); }
.input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid rgba(12,58,91,0.08);
    border-radius: 12px;
    padding: 12px 14px;
    transition: box-shadow .2s ease, border-color .2s ease, transform .05s ease;
}
.input:focus-within {
    box-shadow: none;
    border-color: var(--accent);
}
.input.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.input.has-error svg {
    color: #ef4444;
}
.input svg { flex: 0 0 18px; color: var(--brand-primary); opacity: .85; }
.input input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 16px;
    background: transparent;
    color: var(--text);
}

.actions { margin-top: 6px; display: grid; gap: 8px; }
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), #145881 60%, var(--accent));
    box-shadow: 0 8px 20px rgba(12,58,91,0.25), inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 10px 26px rgba(12,58,91,0.3); }
.btn:active { transform: translateY(1px); }

.legal { font-size: 12px; color: var(--muted); text-align: center; }

/* Layout specifics */
.left { 
    display: grid; 
    gap: 18px;
    align-self: self-start;
    margin-top: 100px;
}

.highlight {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 14px;
    background: rgba(26,163,176,0.08);
    padding: 10px 12px;
    border-radius: 999px;
    width: fit-content;
}

.right { width: 100%; }

/* Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
    .btn, .input { transition: none; }
}

/* Datepicker styles */
.datepicker-wrapper { position: relative; }
.datepicker-toggle {
    border: 0;
    background: transparent;
    padding: 6px;
    margin-left: 4px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--brand-primary);
}
.datepicker-toggle:hover { background: rgba(12,58,91,0.06); }
.datepicker-popup {
    position: absolute;
    right: 0;
    margin-top: 8px;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--card);
    border: 1px solid rgba(12,58,91,0.08);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 9999;
    overflow: hidden;
}
.datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(12,58,91,0.05), transparent);
}
.datepicker-nav {
    display: inline-flex;
    gap: 6px;
}
.datepicker-nav button {
    border: 0;
    background: #fff;
    border: 1px solid rgba(12,58,91,0.08);
    width: 28px; height: 28px;
    border-radius: 8px;
    cursor: pointer;
}
.datepicker-nav button:hover { background: rgba(12,58,91,0.06); }
.datepicker-title { font-weight: 600; color: var(--brand-primary); }
.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 10px 12px 12px;
}
.datepicker-weekday {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}
.datepicker-day {
    border: 0;
    background: #fff;
    border: 1px solid rgba(12,58,91,0.08);
    padding: 8px 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}
.datepicker-day:hover { background: rgba(26,163,176,0.08); border-color: var(--accent); }
.datepicker-day.is-today { outline: 2px solid rgba(26,163,176,0.35); outline-offset: -2px; }
.datepicker-day.is-muted { color: #9aa5b1; opacity: .65; }
.datepicker-day.is-selected { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Appointment info message */
.appointment-info {
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(12,58,91,0.08), rgba(26,163,176,0.08));
    border: 1px solid rgba(26,163,176,0.2);
    border-radius: 12px;
    padding: 16px 18px;
    animation: fadeIn 0.3s ease;
}
.appointment-info-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.appointment-info-content svg {
    flex-shrink: 0;
    color: var(--accent);
    margin-top: 2px;
}
.appointment-info-text {
    flex: 1;
    display: grid;
    gap: 6px;
}
.appointment-info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.appointment-info-details {
    font-size: 15px;
    color: var(--text);
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Success screen */
.success-screen {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.98));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(32px, 5vw, 48px);
    text-align: center;
    animation: fadeIn 0.4s ease;
}
.success-content {
    display: grid;
    gap: 20px;
    align-items: center;
    justify-items: center;
}
.success-icon {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.success-title {
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0;
    line-height: 1.2;
}
.success-details {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}
.success-patient {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.success-appointment {
    font-size: clamp(14px, 1.8vw, 18px);
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Error message */
.error-message {
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(220,38,38,0.08));
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 12px;
    padding: 16px 18px;
    animation: slideDown 0.3s ease;
}
.error-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}
.error-icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.error-text {
    flex: 1;
    display: grid;
    gap: 6px;
}
.error-title {
    font-size: 15px;
    font-weight: 600;
    color: #dc2626;
    margin: 0;
}
.error-description {
    font-size: 14px;
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}
.error-close {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    background: transparent;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}
.error-close:hover {
    color: #dc2626;
    background: rgba(239,68,68,0.1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

