:root {
    --auth-ink: #172033;
    --auth-muted: #687389;
    --auth-line: #e5e9f1;
    --auth-primary: #6d4aff;
    --auth-primary-dark: #5634e7;
    --auth-accent: #ef4fa6;
    --auth-surface: rgba(255, 255, 255, .95);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 13% 15%, rgba(239, 79, 166, .28), transparent 28rem),
        radial-gradient(circle at 88% 82%, rgba(109, 74, 255, .33), transparent 31rem),
        linear-gradient(135deg, #111827 0%, #1e1b4b 48%, #312e81 100%);
}
body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .15;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(330px, .86fr) minmax(500px, 1.14fr);
}
.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 76px);
    color: white;
}
.auth-logo {
    width: min(260px, 58vw);
    max-height: 105px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 12px 28px rgba(0,0,0,.18));
}
.auth-brand-copy { margin: auto 0; padding: 60px 0; }
.auth-brand-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(46px, 5vw, 72px);
    line-height: 1;
    letter-spacing: -.055em;
}
.auth-brand-copy p {
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .03em;
}
.auth-brand-footer { color: rgba(255,255,255,.5); font-size: 13px; }
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(22px, 5vw, 72px);
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(4px);
}
.auth-card {
    width: min(100%, 510px);
    padding: clamp(30px, 4vw, 52px);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 28px;
    background: var(--auth-surface);
    box-shadow: 0 32px 90px rgba(4, 7, 25, .33);
    backdrop-filter: blur(22px);
    animation: auth-card-in .5s ease-out both;
}
.auth-card.auth-card-wide { width: min(100%, 790px); }
@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-mobile-logo { display: none; width: 180px; margin: 0 auto 24px; }
.auth-card-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}
.language-control { display: flex; align-items: center; gap: 9px; }
.language-control label {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.language-control select {
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    color: var(--auth-ink);
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.auth-card h2 {
    margin: 0 0 8px;
    font-size: clamp(29px, 4vw, 38px);
    letter-spacing: -.035em;
}
.auth-subtitle { margin: 0 0 30px; color: var(--auth-muted); line-height: 1.55; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.auth-field { margin-bottom: 19px; }
.auth-grid .auth-field { margin-bottom: 0; }
.auth-field-full { grid-column: 1 / -1; }
.auth-field-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.auth-field label, .auth-label { font-size: 14px; font-weight: 700; }
.auth-help-link { color: var(--auth-primary); font-size: 13px; font-weight: 700; text-decoration: none; }
.auth-help-link:hover { text-decoration: underline; }
.auth-input-wrap { position: relative; }
.auth-control {
    width: 100%;
    height: 54px;
    padding: 0 15px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    outline: none;
    color: var(--auth-ink);
    background: #fbfcfe;
    font: inherit;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
select.auth-control { cursor: pointer; }
.auth-control:hover { border-color: #cbd2df; }
.auth-control:focus {
    border-color: var(--auth-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(109,74,255,.12);
}
.auth-control.is-invalid { border-color: #dc3545; }
.auth-password .auth-control { padding-right: 57px; }
.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    color: var(--auth-muted);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(-50%);
}
.auth-password-toggle:hover { color: var(--auth-primary); background: #f1efff; }
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.55;
}
.auth-check input { width: 17px; height: 17px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--auth-primary); }
.auth-check a { color: var(--auth-primary); font-weight: 700; }
.auth-alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid #fecaca;
    border-radius: 13px;
    color: #991b1b;
    background: #fff1f2;
    font-size: 14px;
    line-height: 1.5;
}
.auth-alert ul { margin: 0; padding-left: 19px; }
.auth-submit {
    width: 100%;
    height: 55px;
    margin-top: 24px;
    border: 0;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark) 58%, #7c3aed);
    box-shadow: 0 13px 28px rgba(109,74,255,.26);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 17px 32px rgba(109,74,255,.34); }
.auth-submit:active { transform: translateY(0); }
.auth-switch {
    margin: 24px 0 0;
    color: var(--auth-muted);
    text-align: center;
    font-size: 14px;
}
.auth-switch a { color: var(--auth-primary); font-weight: 800; text-decoration: none; }
.auth-business {
    display: none;
    grid-column: span 1;
}
.auth-business.visible { display: block; }

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form-panel { min-height: 100vh; background: transparent; }
    .auth-mobile-logo { display: block; }
}
@media (max-width: 640px) {
    .auth-form-panel { align-items: stretch; padding: 0; }
    .auth-card, .auth-card.auth-card-wide { min-height: 100vh; border: 0; border-radius: 0; padding: 30px 22px; }
    .auth-grid { grid-template-columns: 1fr; gap: 0; }
    .auth-grid .auth-field { margin-bottom: 18px; }
    .auth-field-full, .auth-business { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
}
