:root {
    color-scheme: light;
    --blue: #185adb;
    --blue-dark: #0d3f9d;
    --blue-soft: #edf4ff;
    --ink: #162033;
    --muted: #637087;
    --line: #dfe5ef;
    --surface: #ffffff;
    --background: #f3f6fb;
    --danger: #a52232;
    --shadow: 0 28px 80px rgba(26, 45, 82, .13);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 8% 12%, rgba(37, 99, 235, .09), transparent 28rem),
        radial-gradient(circle at 92% 88%, rgba(14, 165, 233, .08), transparent 25rem),
        var(--background);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.55;
}

button, input { font: inherit; }

.site-header {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 760;
    letter-spacing: -.02em;
    text-decoration: none;
}

.brand-mark, .doctolik-logo {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #2876ed, #0d43ad);
    box-shadow: 0 8px 18px rgba(24, 90, 219, .25);
    color: white;
    font-weight: 800;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #517061;
    font-size: 13px;
    font-weight: 650;
}

.secure-label span { color: #20a05a; font-size: 10px; }

.page-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 34px auto 44px;
}

.auth-card, .consent-card {
    overflow: hidden;
    border: 1px solid rgba(213, 221, 234, .92);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card--split {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(340px, .96fr);
}

.client-panel, .form-panel { padding: clamp(32px, 5vw, 58px); }

.client-panel {
    position: relative;
    background: linear-gradient(150deg, #f8fbff 0%, #edf4ff 100%);
    border-right: 1px solid var(--line);
}

.client-panel::after {
    position: absolute;
    right: -90px;
    bottom: -100px;
    width: 250px;
    height: 250px;
    border: 38px solid rgba(37, 99, 235, .045);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.eyebrow {
    display: block;
    margin-bottom: 20px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
    margin-bottom: 12px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.16;
    letter-spacing: -.035em;
}

.lead, .form-panel > p, .consent-header > p {
    color: var(--muted);
}

.connection-visual {
    display: flex;
    align-items: center;
    margin: 24px 0 30px;
}

.client-logo {
    width: 76px;
    height: 76px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 28px rgba(31, 48, 80, .1);
    object-fit: contain;
}

.doctolik-logo { width: 58px; height: 58px; border-radius: 17px; font-size: 24px; }

.connection-line {
    position: relative;
    width: 72px;
    height: 2px;
    margin: 0 12px;
    background: #b8c9e7;
}

.connection-line::before, .connection-line::after, .connection-line i {
    position: absolute;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
    transform: translateY(-50%);
}

.connection-line::before { left: 0; }
.connection-line::after { right: 0; }
.connection-line i { left: calc(50% - 3px); }

.permission-summary { margin-top: 34px; }

.permission-summary h2, .consent-body h2 {
    margin-bottom: 14px;
    font-size: 14px;
    letter-spacing: -.01em;
}

.permission-list {
    display: grid;
    gap: 11px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.permission-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #39465b;
    font-size: 14px;
}

.permission-check {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #dff7e9;
    color: #158148;
    font-size: 12px;
    font-weight: 900;
}

.privacy-note {
    position: relative;
    z-index: 1;
    margin: 26px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.privacy-note span { margin-right: 7px; color: var(--blue); }

.form-panel h2 {
    margin-bottom: 8px;
    font-size: 28px;
    letter-spacing: -.025em;
}

.auth-form { margin-top: 30px; }

.auth-form label {
    display: block;
    margin: 18px 0 7px;
    color: #2d394c;
    font-size: 13px;
    font-weight: 720;
}

.auth-form input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid #cbd4e2;
    border-radius: 11px;
    outline: 0;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}

.auth-form input::placeholder { color: #99a3b3; }

.auth-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(24, 90, 219, .12);
}

.button {
    min-height: 49px;
    padding: 0 22px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 760;
    transition: transform .15s, box-shadow .15s, background .15s;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(24, 90, 219, .3); outline-offset: 2px; }

.button--primary {
    background: linear-gradient(135deg, #2169e7, #124dbd);
    box-shadow: 0 10px 22px rgba(24, 90, 219, .22);
    color: white;
}

.button--primary:hover { box-shadow: 0 13px 28px rgba(24, 90, 219, .3); }

.button--secondary { border: 1px solid var(--line); background: white; color: #425069; }
.button--link { background: transparent; color: var(--muted); }
.button--full { width: 100%; margin-top: 24px; }
.button span { margin-left: 8px; }

.form-help {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.alert {
    display: grid;
    gap: 2px;
    margin: 22px 0 0;
    padding: 13px 15px;
    border: 1px solid #f2c7cc;
    border-radius: 10px;
    background: #fff3f4;
    color: var(--danger);
    font-size: 13px;
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: min(900px, calc(100% - 32px));
    margin: 0 auto 30px;
    color: #7b879a;
    font-size: 12px;
    text-align: center;
}

.consent-card { width: min(680px, 100%); margin: 0 auto; }

.consent-header {
    padding: 42px 48px 30px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfdff, #f6f9fe);
    text-align: center;
}

.connection-visual--compact { justify-content: center; margin: 12px 0 25px; }
.connection-visual--compact .client-logo { width: 64px; height: 64px; border-radius: 17px; }
.connection-visual--compact .doctolik-logo { width: 50px; height: 50px; }
.connection-visual--compact .connection-line { width: 52px; }
.consent-header h1 { font-size: clamp(26px, 5vw, 34px); }

.signed-in-account {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 48px;
    border-bottom: 1px solid var(--line);
}

.account-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
}

.signed-in-account > span:last-child { display: grid; line-height: 1.35; }
.signed-in-account small { color: var(--muted); font-size: 11px; }
.signed-in-account strong { font-size: 14px; }
.signed-in-account em { color: var(--muted); font-size: 12px; font-style: normal; }

.consent-body { padding: 28px 48px; }

.permission-list--boxed { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.permission-list--boxed li { padding: 13px 15px; }
.permission-list--boxed li + li { border-top: 1px solid #edf0f5; }

.consent-actions {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    padding: 22px 48px 30px;
    border-top: 1px solid var(--line);
}

.modal-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 24px;
    background: rgba(13, 25, 47, .64);
    backdrop-filter: blur(5px);
}

.connection-modal {
    width: min(460px, 100%);
    padding: 38px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 22px;
    background: white;
    box-shadow: 0 30px 90px rgba(2, 12, 32, .34);
    text-align: center;
}

.status-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #dff7e9;
    color: #128047;
    font-size: 25px;
    font-weight: 900;
}

.connected-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.connection-modal h2 { margin-bottom: 10px; font-size: 25px; line-height: 1.22; letter-spacing: -.025em; }
.connection-modal > p { color: var(--muted); font-size: 14px; }

.modal-client {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 4px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8faff;
    text-align: left;
}

.modal-client img { width: 44px; height: 44px; padding: 4px; border-radius: 11px; background: white; object-fit: contain; }
.modal-client span { display: grid; }
.modal-client strong { font-size: 14px; }
.modal-client small { color: var(--muted); font-size: 11px; }
.connection-modal .button--link { margin-top: 8px; }

@media (max-width: 760px) {
    .site-header { width: min(100% - 28px, 620px); padding: 18px 0; }
    .secure-label { font-size: 0; }
    .secure-label span { font-size: 11px; }
    .page-shell { margin-top: 12px; }
    .auth-card--split { grid-template-columns: 1fr; }
    .client-panel { border-right: 0; border-bottom: 1px solid var(--line); }
    .client-panel, .form-panel { padding: 30px 26px; }
    .permission-summary { margin-top: 24px; }
    .consent-header, .consent-body { padding-right: 26px; padding-left: 26px; }
    .signed-in-account { padding-right: 26px; padding-left: 26px; }
    .consent-actions { flex-direction: column; padding: 20px 26px 26px; }
    .consent-actions form, .consent-actions .button { width: 100%; }
    .site-footer { flex-direction: column; gap: 2px; }
    .site-footer span[aria-hidden] { display: none; }
}

@media (max-width: 420px) {
    .page-shell { width: min(100% - 20px, 400px); }
    .auth-card, .consent-card { border-radius: 17px; }
    .connection-visual { margin-top: 18px; }
    .client-logo { width: 62px; height: 62px; border-radius: 16px; }
    .doctolik-logo { width: 50px; height: 50px; }
    .connection-line { width: 45px; }
    .connection-modal { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
