:root {
    --auth-bg: #fff8ef;
    --auth-panel: rgba(255, 255, 255, 0.74);
    --auth-text: #4c3626;
    --auth-muted: #8f7966;
    --auth-gold: #c99b5f;
    --auth-gold-deep: #a97740;
    --auth-line: rgba(201, 155, 95, 0.18);
    --auth-shadow: 0 34px 90px rgba(128, 82, 35, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-page {
    min-height: 100vh;
    font-family: 'Jost', sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.18) 30%, transparent 48%),
        radial-gradient(circle at 82% 78%, rgba(220, 174, 100, 0.22) 0%, transparent 34%),
        linear-gradient(135deg, #fffdfa 0%, #f7eee2 100%);
}

.auth-shell {
    width: min(1160px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(22px, 4vw, 56px);
    padding: 42px 0;
}

.auth-card,
.auth-side-panel {
    position: relative;
    border: 1px solid rgba(255,255,255,0.7);
    background: var(--auth-panel);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.auth-card {
    display: grid;
    gap: 18px;
    padding: clamp(26px, 4vw, 44px);
    border-radius: 34px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.auth-brand span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    color: #fffaf3;
    background: linear-gradient(135deg, #e0bd83 0%, #b47b44 100%);
    box-shadow: 0 16px 30px rgba(154, 119, 64, 0.2);
}

.auth-brand strong,
.auth-card h1,
.auth-side-panel h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.auth-brand strong { font-size: 24px; }

.auth-eyebrow,
.auth-side-kicker {
    margin-top: 5px;
    color: var(--auth-gold-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.auth-card h1 {
    max-width: 8ch;
    color: #aa7240;
    font-size: clamp(46px, 7vw, 70px);
    line-height: 0.92;
}

.auth-card p,
.auth-role-grid p { color: var(--auth-muted); line-height: 1.75; }

.auth-alert {
    padding: 14px 16px;
    border-radius: 18px;
    color: #8e3f2d;
    background: rgba(255, 231, 220, 0.78);
    border: 1px solid rgba(199, 99, 73, 0.18);
}

.auth-alert.is-success {
    color: #47682f;
    background: rgba(231, 246, 219, 0.78);
    border-color: rgba(97, 143, 63, 0.18);
}

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

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-form input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 17px;
    color: var(--auth-text);
    background: rgba(255,255,255,0.84);
    border: 1px solid var(--auth-line);
    outline: none;
    font: inherit;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.auth-form input:focus {
    border-color: rgba(201,155,95,0.55);
    box-shadow: 0 0 0 4px rgba(201,155,95,0.12);
}

.auth-form button {
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    color: #fffaf3;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #e3c18d 0%, #cb9c61 44%, #b57d48 100%);
    box-shadow: 0 18px 36px rgba(181, 125, 72, 0.2);
}

.auth-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.auth-action-row button {
    width: 100%;
}

.auth-action-row .auth-secondary-button {
    min-width: 160px;
    color: var(--auth-gold-deep);
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(201, 155, 95, 0.28);
    box-shadow: none;
}

.auth-register-block {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-line);
}

.auth-form-title {
    color: var(--auth-gold-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.auth-form-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-form-compact button {
    grid-column: 1 / -1;
}

.auth-demo-box {
    display: grid;
    gap: 7px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 248, 235, 0.72);
    border: 1px solid var(--auth-line);
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-demo-box strong { color: var(--auth-text); }

.auth-side-panel {
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: clamp(24px, 5vw, 54px);
    border-radius: 44px;
    background: linear-gradient(145deg, rgba(255,255,255,0.38) 0%, rgba(255,239,214,0.68) 58%, rgba(181,125,72,0.18) 100%);
}

.auth-side-panel::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 360px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.82) 0%, rgba(255,219,164,0.22) 48%, transparent 72%);
    filter: blur(8px);
}

.auth-side-panel h2 {
    position: relative;
    max-width: 11ch;
    margin-top: 10px;
    color: #8d5a30;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 0.9;
}

.auth-role-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 32px;
}

.auth-role-grid article {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.48);
    border: 1px solid rgba(255,255,255,0.62);
}

.auth-role-grid span {
    color: var(--auth-gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.auth-role-grid strong { margin-top: auto; font-size: 18px; }
.auth-role-grid p { margin-top: 10px; font-size: 13px; }

.auth-promo-grid {
    position: relative;
    display: grid;
    gap: 14px;
    margin-top: 30px;
}

.auth-promo-carousel {
    position: relative;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 26px;
    outline: none;
}

.auth-promo-viewport {
    position: relative;
    min-height: 540px;
}

.auth-promo-card {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    display: block;
    border-radius: 24px;
    color: #fffaf3;
    text-decoration: none;
    background: rgba(255,255,255,0.48);
    border: 1px solid rgba(255,255,255,0.62);
    box-shadow: 0 18px 42px rgba(128, 82, 35, 0.16);
}

.auth-promo-carousel .auth-promo-card {
    position: absolute;
    inset: 0;
    min-height: 540px;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 420ms ease, transform 620ms ease;
}

.auth-promo-carousel .auth-promo-card.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.auth-promo-card img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: block;
    object-fit: cover;
}

.auth-promo-carousel .auth-promo-card img {
    min-height: 540px;
    object-position: center center !important;
}

.auth-promo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(76, 54, 38, 0.76) 100%);
}

.auth-promo-card span {
    position: absolute;
    z-index: 1;
    left: 18px;
    right: 18px;
    bottom: 16px;
    display: grid;
    gap: 4px;
}

.auth-promo-card strong {
    font-size: 18px;
    line-height: 1.15;
}

.auth-promo-card small {
    color: rgba(255,250,243,0.86);
    font-size: 13px;
    line-height: 1.35;
}

.auth-promo-empty {
    position: relative;
    display: grid;
    gap: 10px;
    margin-top: 30px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255,255,255,0.48);
    border: 1px solid rgba(255,255,255,0.62);
}

.auth-promo-empty p {
    color: var(--auth-muted);
    line-height: 1.6;
}

.auth-promo-controls {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-promo-meta {
    margin-right: auto;
}

.auth-promo-count {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    line-height: 0.9;
    color: #fffaf3;
    text-shadow: 0 8px 18px rgba(76,54,38,0.42);
}

.auth-promo-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    appearance: none;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255,252,247,0.78) 0%, rgba(247,229,204,0.42) 100%);
    border: 1px solid rgba(255,255,255,0.52);
    color: #9a6739;
    box-shadow: 0 16px 36px rgba(76,54,38,0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.auth-promo-arrow:hover {
    transform: translateY(-2px) scale(1.04);
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(249,236,214,0.62) 100%);
    box-shadow: 0 22px 44px rgba(76,54,38,0.24);
}

.auth-promo-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.28);
    box-shadow: 0 18px 36px rgba(76,54,38,0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-promo-dot {
    width: 24px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    cursor: pointer;
    background: rgba(255,250,243,0.46);
    transition: width 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.auth-promo-dot.is-active {
    width: 52px;
    background: linear-gradient(90deg, rgba(233,197,142,0.98) 0%, rgba(202,145,72,0.98) 100%);
    transform: scale(1.04);
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.auth-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(76, 54, 38, 0.36);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-modal-panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    display: grid;
    gap: 18px;
    padding: clamp(24px, 4vw, 38px);
    border-radius: 30px;
    color: var(--auth-text);
    background: rgba(255, 253, 250, 0.94);
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: 0 34px 90px rgba(76, 54, 38, 0.22);
    transform: translateY(12px) scale(0.98);
    transition: transform 180ms ease;
}

.auth-modal.is-open .auth-modal-panel {
    transform: translateY(0) scale(1);
}

.auth-modal-panel h2 {
    max-width: 10ch;
    color: #aa7240;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(38px, 6vw, 58px);
    font-weight: 600;
    line-height: 0.92;
}

.auth-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--auth-line);
    border-radius: 50%;
    color: var(--auth-gold-deep);
    cursor: pointer;
    background: rgba(255,255,255,0.8);
    font: inherit;
    font-size: 24px;
    line-height: 1;
}

.auth-form-modal {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; padding: 24px 0; }
    .auth-card h1, .auth-side-panel h2 { max-width: none; }
    .auth-side-panel { min-height: 0; }
    .auth-role-grid { grid-template-columns: 1fr; }
    .auth-form-compact { grid-template-columns: 1fr; }
    .auth-action-row { grid-template-columns: 1fr; }
    .auth-promo-viewport,
    .auth-promo-carousel .auth-promo-card,
    .auth-promo-carousel .auth-promo-card img { min-height: 320px; }
    .auth-promo-controls { left: 12px; right: 12px; bottom: 12px; gap: 8px; }
    .auth-promo-meta { display: none; }
    .auth-promo-arrow { width: 40px; height: 40px; }
    .auth-promo-dot { width: 18px; }
    .auth-promo-dot.is-active { width: 38px; }
}
