:root {
    --medical-blue: #1d75bd;
    --medical-blue-dark: #155a91;
    --medical-blue-soft: #eaf5ff;
    --medical-green: #21a67a;
    --text: #17324d;
    --muted: #64748b;
    --line: #dbe7f3;
    --bg: #f6fbff;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: var(--medical-blue);
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.btn-primary {
    --bs-btn-bg: var(--medical-blue);
    --bs-btn-border-color: var(--medical-blue);
    --bs-btn-hover-bg: var(--medical-blue-dark);
    --bs-btn-hover-border-color: var(--medical-blue-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--medical-blue);
    --bs-btn-border-color: var(--medical-blue);
    --bs-btn-hover-bg: var(--medical-blue);
    --bs-btn-hover-border-color: var(--medical-blue);
}

.hero-section,
.auth-section,
.dashboard-section {
    padding: clamp(32px, 7vw, 84px) 0;
}

.hero-section h1,
.auth-card h1,
.dashboard-header h1 {
    max-width: 820px;
    margin: 0;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.08;
}

.hero-section h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--medical-blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.info-card,
.auth-card,
.portal-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(29, 117, 189, .08);
}

.info-card {
    padding: 28px;
}

.info-card h2,
.portal-card h2 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
}

.info-card ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.auth-section {
    display: grid;
    min-height: calc(100vh - 130px);
    place-items: center;
    padding-left: 16px;
    padding-right: 16px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 26px;
}

.auth-card-wide {
    width: min(720px, 100%);
}

.form-control {
    border-color: var(--line);
    border-radius: 8px;
    padding: 11px 12px;
}

.form-control:focus {
    border-color: var(--medical-blue);
    box-shadow: 0 0 0 .2rem rgba(29, 117, 189, .14);
}

.invalid-text {
    margin-top: 6px;
    color: #b42318;
    font-size: 14px;
}

.dashboard-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.portal-card {
    height: 100%;
    padding: 22px;
}

.profile-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.profile-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.profile-list dd {
    margin: -8px 0 0;
    font-weight: 650;
}

.document-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.document-table td,
.document-table th {
    border-color: var(--line);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .hero-section,
    .auth-section,
    .dashboard-section {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .hero-section h1,
    .auth-card h1,
    .dashboard-header h1 {
        font-size: 30px;
    }

    .auth-card,
    .portal-card,
    .info-card {
        padding: 18px;
    }

    .dashboard-header {
        display: block;
    }
}

.appointment-heading {
    flex-wrap: wrap;
}

.appointment-date-control {
    display: flex;
    min-width: min(100%, 420px);
    gap: 10px;
}

.appointment-date-control .form-control {
    min-width: 170px;
}

.appointment-status {
    min-height: 24px;
    margin-bottom: 16px;
    font-weight: 650;
}

.appointment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.doctor-schedule {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fbfdff;
}

.doctor-title {
    color: var(--text);
    font-weight: 800;
    line-height: 1.25;
}

.doctor-specialization {
    min-height: 20px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.slot-button {
    min-width: 82px;
    height: 36px;
    border: 1px solid var(--medical-blue);
    border-radius: 8px;
    background: #fff;
    color: var(--medical-blue);
    font-weight: 750;
}

.slot-button:hover,
.slot-button.is-selected {
    background: var(--medical-blue);
    color: #fff;
}

.appointment-form {
    max-width: 680px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.selected-slot {
    display: inline-flex;
    max-width: 100%;
    border-radius: 8px;
    background: var(--medical-blue-soft);
    padding: 10px 12px;
    color: var(--text);
    font-weight: 750;
}

@media (max-width: 768px) {
    .appointment-date-control,
    .appointment-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .appointment-date-control .btn,
    .appointment-actions .btn {
        width: 100%;
    }
}


.barcode-card {
    display: inline-flex;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.barcode-svg {
    display: block;
    width: min(220px, 100%);
    height: auto;
}


.doctor-day-schedule {
    display: grid;
    gap: 14px;
}

.doctor-day-header {
    color: var(--text);
    font-weight: 800;
}

.doctor-interval-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.doctor-interval {
    display: grid;
    min-height: 76px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    align-content: center;
    gap: 3px;
}

.doctor-interval.is-free {
    border-left-color: var(--medical-green);
}

.doctor-interval.is-busy {
    border-left-color: #b42318;
    background: #fff8f7;
}

.doctor-interval-time {
    font-size: 16px;
    font-weight: 850;
}

.doctor-interval-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.doctor-interval-kind {
    color: var(--muted);
    font-size: 13px;
}

.doctor-day-empty {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
}

@media (max-width: 768px) {
    .doctor-interval-list {
        grid-template-columns: 1fr;
    }
}



.login-is-loading {
    overflow: hidden;
}

.login-loading-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(245, 250, 255, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.login-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.login-loading-panel {
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    padding: 34px 28px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(24, 73, 116, 0.18);
}

.login-loading-mark {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    background: var(--medical-blue);
    color: #fff;
    font-size: 42px;
    font-weight: 500;
    line-height: 1;
    animation: login-mark-pulse 1.5s ease-in-out infinite;
}

.login-loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 18px;
    border: 3px solid var(--medical-blue-soft);
    border-top-color: var(--medical-blue);
    border-radius: 50%;
    animation: login-spinner 0.8s linear infinite;
}

.login-loading-title {
    color: var(--text);
    font-size: 21px;
    font-weight: 800;
}

.login-loading-text {
    margin-top: 7px;
    color: var(--muted);
    font-size: 14px;
}

@keyframes login-spinner {
    to { transform: rotate(360deg); }
}

@keyframes login-mark-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(29, 117, 189, 0.22); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(29, 117, 189, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .login-loading-overlay {
        transition: none;
    }
    .login-loading-mark,
    .login-loading-spinner {
        animation: none;
    }
}
