:root {
    --deep-blue: #0a2540;
    --deep-blue-light: #1a3a5c;
    --teal: #14b8a6;
    --teal-dark: #0d9488;
    --teal-glow: rgba(20, 184, 166, 0.15);
    --white: #ffffff;
    --off-white: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.06);
    --shadow-md: 0 4px 20px rgba(10, 37, 64, 0.08);
    --shadow-lg: 0 12px 40px rgba(10, 37, 64, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--deep-blue);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ECG Animation */
.ecg-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0.12;
    overflow: hidden;
    pointer-events: none;
}

.ecg-line svg {
    width: 200%;
    height: 100%;
    animation: ecg-scroll 8s linear infinite;
}

@keyframes ecg-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.header.scrolled {
    border-bottom-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--deep-blue);
}

.logo__icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--deep-blue), var(--teal));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition);
}

.nav a:hover {
    color: var(--teal-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn--primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
}

.btn--outline {
    background: transparent;
    color: var(--deep-blue);
    border: 2px solid var(--deep-blue);
}

.btn--outline:hover {
    background: var(--deep-blue);
    color: white;
}

.btn--white {
    background: white;
    color: var(--deep-blue);
}

.btn--white:hover {
    background: var(--off-white);
    transform: translateY(-2px);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-logout-form {
    display: inline;
    margin: 0;
}

.nav-logout-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

#login-open-btn {
    font-family: inherit;
}

/* Login modal */
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.login-modal--open {
    opacity: 1;
    visibility: visible;
}

.login-modal[hidden]:not(.login-modal--open) {
    display: none;
}

body.login-modal-active {
    overflow: hidden;
}

.login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 37, 64, 0.55);
    backdrop-filter: blur(4px);
}

.login-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.login-modal--open .login-modal__dialog {
    transform: translateY(0) scale(1);
}

.login-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px;
    line-height: 0;
}

.login-modal__close:hover {
    color: var(--deep-blue);
}

.login-modal__title {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.login-modal__subtitle {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 24px;
    line-height: 1.5;
}

.login-modal__form .form-group {
    margin-bottom: 16px;
}

.login-modal__form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.login-modal__form input[type="email"],
.login-modal__form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
}

.login-modal__form input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.login-modal__remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    cursor: pointer;
}

.login-modal__submit {
    width: 100%;
}

.login-modal__footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-600);
    text-align: center;
}

.login-modal__footer p {
    margin: 0 0 8px;
}

.login-modal__footer a {
    color: var(--teal-dark);
    font-weight: 600;
}

.login-modal__alert {
    margin-bottom: 16px;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--teal-dark);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    background: linear-gradient(160deg, var(--off-white) 0%, #eef7f6 50%, var(--white) 100%);
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--teal-glow);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal-dark);
    margin-bottom: 24px;
    animation: fade-up 0.6s ease-out;
}

.hero__badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    margin-bottom: 16px;
    animation: fade-up 0.6s ease-out 0.1s both;
}

.hero__title {
    font-size: 1.15rem;
    color: var(--teal-dark);
    font-weight: 600;
    margin-bottom: 20px;
    animation: fade-up 0.6s ease-out 0.2s both;
}

.hero__tagline {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 480px;
    margin-bottom: 36px;
    animation: fade-up 0.6s ease-out 0.3s both;
}

.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    animation: fade-up 0.6s ease-out 0.4s both;
}

.hero__visual {
    position: relative;
    animation: fade-up 0.8s ease-out 0.3s both;
}

.hero__card {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.hero__avatar {
    width: 100%;
    max-width: 360px;
    height: 380px;
    margin: 0 auto 24px;
    background: var(--deep-blue);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero__avatar-inner {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(20, 184, 166, 0.5);
}

.hero__avatar-inner svg {
    width: 60px;
    height: 60px;
    color: var(--teal);
}

.hero__card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
}

.hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 20px;
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hero__stat {
    text-align: center;
    padding: 16px;
    background: var(--off-white);
    border-radius: var(--radius-sm);
}

.hero__stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--deep-blue);
}

.hero__stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero__float {
    position: absolute;
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deep-blue);
    animation: float 4s ease-in-out infinite;
}

.hero__float--1 {
    top: 20px;
    right: -20px;
    animation-delay: 0s;
}

.hero__float--2 {
    bottom: 60px;
    left: -30px;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
.section {
    padding: 100px 0;
}

.section--alt {
    background: var(--off-white);
}

.section__header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 60px;
}

.section__label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--teal-dark);
    margin-bottom: 12px;
}

.section__header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 16px;
}

.section__header p {
    color: var(--gray-600);
    font-size: 1.05rem;
}

/* About */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
}

.about__image {
    position: relative;
    background: linear-gradient(135deg, var(--deep-blue), var(--deep-blue-light));
    border-radius: 24px;
    padding: 48px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about__heart {
    width: 180px;
    height: 180px;
    color: var(--teal);
    opacity: 0.9;
    animation: heartbeat 2s ease-in-out infinite;
}

.about__card-img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    background: #fff;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.08); }
    30% { transform: scale(1); }
    45% { transform: scale(1.05); }
}

.about__content h2 {
    font-size: 2.25rem;
    margin-bottom: 20px;
}

.about__content p {
    color: var(--gray-600);
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.credentials-list {
    list-style: none;
    margin-top: 28px;
}

.credentials-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.95rem;
    color: var(--gray-800);
}

.credentials-list li::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--teal-glow);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2314b8a6'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Services */
.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.service-card__icon {
    width: 52px;
    height: 52px;
    background: var(--teal-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--teal-dark);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.65;
}

/* Testimonials */
.testimonials__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.testimonial-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--gray-200);
    position: relative;
    transition: var(--transition);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-md);
}

.testimonial-card::before {
    content: '"';
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    color: var(--teal);
    opacity: 0.3;
    line-height: 1;
    position: absolute;
    top: 16px;
    left: 24px;
}

.testimonial-card__quote {
    font-size: 0.95rem;
    color: var(--gray-600);
    font-style: italic;
    margin-bottom: 24px;
    padding-top: 24px;
    line-height: 1.7;
}

.testimonial-card__author {
    font-weight: 700;
    color: var(--deep-blue);
}

.testimonial-card__detail {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* Appointment */
.appointment {
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-light) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.appointment .section__label {
    color: var(--teal);
}

.appointment .section__header h2,
.appointment .section__header p {
    color: white;
}

.appointment .section__header p {
    opacity: 0.85;
}

.appointment__grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 48px;
    align-items: start;
}

.appointment__info h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.contact-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.contact-item__icon {
    width: 44px;
    height: 44px;
    background: rgba(20, 184, 166, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--teal);
}

.contact-item__text {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

.appointment__form {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition);
    background: var(--off-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    background: white;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.alert--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Footer */
.footer {
    background: var(--deep-blue);
    color: rgba(255, 255, 255, 0.8);
    padding: 48px 0 24px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer__brand .logo {
    color: white;
    margin-bottom: 16px;
}

.footer__hospital {
    margin-top: 12px;
}

.footer__hospital a {
    color: var(--teal);
    font-weight: 500;
}

.footer__hospital a:hover {
    text-decoration: underline;
}

.contact-item__text a {
    color: var(--teal-dark);
}

.contact-item__text a:hover {
    text-decoration: underline;
}

.footer__brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer h4 {
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul a {
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer ul a:hover {
    color: var(--teal);
}

.footer__bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Mobile floating actions */
.mobile-fab {
    display: none;
}

@media (max-width: 768px) {
    .mobile-fab {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        bottom: 20px;
        left: 16px;
        right: 16px;
        z-index: 1000;
        pointer-events: none;
    }

    .mobile-fab__btn {
        pointer-events: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 50px;
        font-family: 'DM Sans', system-ui, sans-serif;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none;
        box-shadow: 0 8px 24px rgba(10, 37, 64, 0.2);
        transition: transform var(--transition), box-shadow var(--transition);
    }

    .mobile-fab__btn:active {
        transform: scale(0.97);
    }

    .mobile-fab__btn--whatsapp {
        flex-shrink: 0;
        width: 52px;
        height: 52px;
        background: #25d366;
        color: #fff;
    }

    .mobile-fab__btn--whatsapp:hover {
        background: #20bd5a;
        box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45);
    }

    .mobile-fab__btn--book {
        flex: 1;
        min-height: 52px;
        padding: 0 20px;
        background: var(--deep-blue);
        color: #fff;
    }

    .mobile-fab__btn--book:hover {
        background: var(--deep-blue-light);
        box-shadow: 0 10px 28px rgba(10, 37, 64, 0.3);
    }

    body {
        padding-bottom: 88px;
    }
}

/* Mobile */
@media (max-width: 992px) {
    .hero__grid,
    .about__grid,
    .appointment__grid {
        grid-template-columns: 1fr;
    }

    .services__grid,
    .testimonials__grid {
        grid-template-columns: 1fr;
    }

    .footer__grid {
        grid-template-columns: 1fr;
    }

    .hero__visual {
        order: -1;
    }

    .hero__avatar {
        max-width: 100%;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
    }

    .nav.open {
        display: flex;
    }

    .nav.open .btn,
    .nav.open .nav-logout-form {
        width: 100%;
    }

    .nav.open #login-open-btn,
    .nav.open .nav-logout-btn {
        width: 100%;
        justify-content: center;
    }

    .mobile-toggle {
        display: block;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding-top: 100px;
    }

    .hero__float {
        display: none;
    }
}
