:root {
    --patient-bg: #f6efe5;
    --patient-surface: rgba(255, 250, 244, 0.88);
    --patient-surface-strong: #fffdf9;
    --patient-border: rgba(21, 54, 51, 0.12);
    --patient-text: #17312e;
    --patient-text-soft: #58706a;
    --patient-accent: #0f766e;
    --patient-accent-strong: #0b5f59;
    --patient-accent-soft: #dff4ef;
    --patient-warm: #f4a261;
    --patient-error: #a63d40;
    --patient-error-soft: #fde8e9;
    --patient-success: #216869;
    --patient-success-soft: #e3f4ef;
    --patient-shadow: 0 24px 80px rgba(24, 38, 37, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--patient-text);
    background:
        radial-gradient(circle at top left, rgba(244, 162, 97, 0.34), transparent 28%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 30%),
        linear-gradient(135deg, #fbf6ef 0%, #eef7f4 46%, #f9efe5 100%);
}

.patient-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
    gap: 14px;
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.patient-auth::before,
.patient-auth::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(10px);
    pointer-events: none;
}

.patient-auth::before {
    width: 320px;
    height: 320px;
    background: rgba(15, 118, 110, 0.08);
    top: -120px;
    right: 14%;
}

.patient-auth::after {
    width: 220px;
    height: 220px;
    background: rgba(244, 162, 97, 0.14);
    bottom: -80px;
    left: 10%;
}







/* .patient-auth__hero_wrapper{

} */






.patient-auth__hero,
.patient-auth__panel {
    position: relative;
    z-index: 1;
}

.patient-auth__hero {
    width: min(100%, 620px);
    margin-left: auto;
    padding: 28px 18px 28px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.patient-auth__badge {
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(23, 49, 46, 0.1);
    color: var(--patient-accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.patient-auth__hero h1 {
    margin: 22px 0 14px;
    max-width: 10ch;
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 5.6vw, 5.4rem);
    line-height: 0.94;
    font-weight: 400;
}

.patient-auth__hero p {
    margin: 0;
    max-width: 56ch;
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--patient-text-soft);
}

.patient-auth__panel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.auth-card {
    width: min(100%, 580px);
    border-radius: 12px;
    border: 1px solid var(--patient-border);
    background: var(--patient-surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--patient-shadow);
    overflow: hidden;
}

.auth-card__topbar {
    display: flex;
    padding: 12px;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(23, 49, 46, 0.08);
}

.auth-card__tab {
    flex: 1;
    border: 0;
    padding: 14px 18px;
    border-radius: 8px;
    background: transparent;
    color: var(--patient-text-soft);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.auth-card__tab:hover {
    transform: translateY(-1px);
}

.auth-card__tab--active {
    background: var(--patient-accent-soft);
    color: var(--patient-accent-strong);
}

.auth-card__message {
    margin: 18px 22px 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.96rem;
    line-height: 1.6;
    border: 1px solid transparent;
}

.auth-card__message[data-type='error'] {
    background: var(--patient-error-soft);
    color: var(--patient-error);
    border-color: rgba(166, 61, 64, 0.14);
}

.auth-card__message[data-type='success'] {
    background: var(--patient-success-soft);
    color: var(--patient-success);
    border-color: rgba(33, 104, 105, 0.14);
}

.auth-card__message[data-type='info'] {
    background: #eef5ff;
    color: #28578b;
    border-color: rgba(40, 87, 139, 0.12);
}

.auth-card__viewport {
    overflow: hidden;
    position: relative;
}

.auth-card__track {
    display: grid;
    width: 100%;
}

.auth-card__screen {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;
    padding: 28px 22px 26px;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.auth-card__screen:first-child {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.auth-card__screen:last-child {
    transform: translate3d(100%, 0, 0);
    opacity: 0.72;
}

.patient-auth__panel[data-mode='first-access'] .auth-card__screen:first-child,
.auth-card[data-mode='first-access'] .auth-card__screen:first-child {
    transform: translate3d(-100%, 0, 0);
    opacity: 0.72;
}

.patient-auth__panel[data-mode='first-access'] .auth-card__screen:last-child,
.auth-card[data-mode='first-access'] .auth-card__screen:last-child {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.auth-card__header {
    margin-bottom: 22px;
}

.auth-card__eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--patient-accent);
}

.auth-card__header h2 {
    margin: 10px 0 10px;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    line-height: 1.05;
}

.auth-card__header p {
    margin: 0;
    color: var(--patient-text-soft);
    line-height: 1.65;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field span {
    font-size: 0.95rem;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    border: 1px solid rgba(23, 49, 46, 0.12);
    border-radius: 8px;
    background: var(--patient-surface-strong);
    color: var(--patient-text);
    padding: 16px 18px;
    font: inherit;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.auth-field input:focus {
    border-color: rgba(15, 118, 110, 0.44);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    transform: translateY(-1px);
}

.auth-field input:disabled {
    color: var(--patient-accent-strong);
    background: linear-gradient(135deg, rgba(223, 244, 239, 0.85), rgba(255, 255, 255, 0.96));
    border-color: rgba(15, 118, 110, 0.22);
    cursor: not-allowed;
    font-weight: 700;
    opacity: 1;
}

.auth-button,
.auth-link {
    font: inherit;
}

.auth-button {
    border: 0;
    border-radius: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--patient-accent), #149388);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
    box-shadow: 0 18px 28px rgba(15, 118, 110, 0.18);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 34px rgba(15, 118, 110, 0.24);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.auth-button--secondary {
    background: linear-gradient(135deg, #f0f6f4, #dcedea);
    color: var(--patient-accent-strong);
    box-shadow: none;
}

.auth-link {
    margin-top: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--patient-accent-strong);
    font-weight: 700;
    line-height: 1.6;
    text-align: left;
    cursor: pointer;
}

.auth-link--back {
    color: var(--patient-text-soft);
}

.patient-match {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(15, 118, 110, 0.06);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.patient-match__greeting {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
}

.patient-match__text {
    margin: 8px 0 18px;
    color: var(--patient-text-soft);
    line-height: 1.6;
}

@media (max-width: 980px) {
    .patient-auth {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }

    .patient-auth__hero {
        width: 100%;
        margin-left: 0;
        padding: 8px 0;
    }

    .patient-auth__hero h1 {
        max-width: 100%;
    }

    .patient-auth__panel {
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .patient-auth {
        padding: 14px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-card__screen {
        padding: 22px 16px 18px;
    }

    .auth-card__topbar {
        padding: 8px;
    }

    .auth-card__tab {
        padding: 12px;
        font-size: 0.94rem;
    }
}