:root {
    --auth-primary: #f59b23;
    --auth-primary-dark: #d97900;
    --auth-text: #20232a;
    --auth-muted: #737b88;
    --auth-border: #e2e6eb;
    --auth-bg: #f2f4f7;
    --auth-danger: #bd3e3e;
    --auth-danger-soft: #fff0f0;
    --auth-warning: #9a6200;
    --auth-warning-soft: #fff5d9;
    --auth-success: #258f58;
    --auth-success-soft: #eaf8f0;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: Inter, Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid rgba(245, 155, 35, 0.3);
    outline-offset: 2px;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.15fr);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(30px, 5vw, 64px);
    background:
        radial-gradient(circle at 0 0, rgba(245, 155, 35, 0.28), transparent 320px),
        linear-gradient(145deg, #16181e, #2b2f38);
    color: #fff;
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(245, 155, 35, 0.16);
    border-radius: 50%;
    box-shadow: 0 0 0 65px rgba(245, 155, 35, 0.04);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 12px;
}

.auth-brand-mark {
    display: grid;
    width: 49px;
    height: 49px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #ffb34a, var(--auth-primary));
    font-size: 20px;
    box-shadow: 0 13px 30px rgba(245, 155, 35, 0.25);
}

.auth-brand strong,
.auth-brand small { display: block; }
.auth-brand strong { font-size: 20px; }
.auth-brand small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: auto 0;
    padding: 50px 0;
}

.auth-brand-copy span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 195, 113, 0.22);
    border-radius: 999px;
    background: rgba(245, 155, 35, 0.1);
    color: #ffc77e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-brand-copy h1 {
    margin: 21px 0 14px;
    font-size: clamp(34px, 5vw, 55px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.auth-brand-copy p {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.8;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.38);
    font-size: 9px;
}

.auth-main {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: clamp(22px, 5vw, 64px);
}

.auth-card {
    width: min(100%, 480px);
    padding: clamp(25px, 5vw, 40px);
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(24, 29, 42, 0.1);
}

.auth-card.wide { width: min(100%, 650px); }
.auth-card-header { margin-bottom: 24px; }
.auth-card-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #fff3e2;
    color: var(--auth-primary-dark);
    font-size: 19px;
}
.auth-card h2 {
    margin: 0;
    font-size: clamp(23px, 4vw, 31px);
    letter-spacing: -0.035em;
}
.auth-card-header p,
.auth-card > p {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 10px;
    line-height: 1.7;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    padding: 12px 13px;
    border-radius: 11px;
    font-size: 9px;
    line-height: 1.55;
}
.auth-alert.error { background: var(--auth-danger-soft); color: var(--auth-danger); }
.auth-alert.warning { background: var(--auth-warning-soft); color: var(--auth-warning); }
.auth-alert.success { background: var(--auth-success-soft); color: var(--auth-success); }
.auth-alert strong, .auth-alert span { display: block; }
.auth-alert div span { margin-top: 3px; }

.auth-form-group { margin-bottom: 16px; }
.auth-form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 9px;
    font-weight: 800;
}
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fbfcfd;
    color: var(--auth-text);
    outline: 0;
    transition: 0.2s ease;
}
.auth-input.with-button { padding-right: 48px; }
.auth-input:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(245, 155, 35, 0.09);
}
.auth-input.code-input {
    min-height: 58px;
    font-family: "Courier New", monospace;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
}
.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}
.auth-password-toggle:hover { background: #f2f4f7; color: var(--auth-text); }

.auth-button {
    display: inline-flex;
    width: 100%;
    min-height: 47px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary), #f2aa4b);
    color: #fff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 11px 24px rgba(245, 155, 35, 0.2);
}
.auth-button:hover { background: linear-gradient(135deg, var(--auth-primary-dark), var(--auth-primary)); }
.auth-button:disabled { cursor: wait; opacity: 0.68; }
.auth-button.secondary {
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text);
    box-shadow: none;
}

.auth-card-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    text-align: center;
}
.auth-card-footer a {
    color: var(--auth-primary-dark);
    font-size: 9px;
    font-weight: 800;
}
.auth-card-footer a:hover { text-decoration: underline; }

.auth-steps {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    padding: 0;
    counter-reset: auth-steps;
    list-style: none;
}
.auth-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-muted);
    font-size: 9px;
    line-height: 1.6;
}
.auth-steps li::before {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 8px;
    background: #fff3e2;
    color: var(--auth-primary-dark);
    font-size: 8px;
    font-weight: 800;
    content: counter(auth-steps);
    counter-increment: auth-steps;
}

.qr-box {
    display: grid;
    place-items: center;
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    background: #fff;
}
.qr-box img { display: block; width: min(280px, 100%); height: auto; }
.secret-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 18px;
    padding: 12px;
    border-radius: 11px;
    background: #f4f6f8;
}
.secret-box code {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
}
.copy-mini {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    font-size: 8px;
    font-weight: 800;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 20px 0;
}
.recovery-code {
    padding: 12px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #f7f8fa;
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.recovery-actions {
    display: flex;
    gap: 9px;
    margin-top: 18px;
}
.recovery-actions > * { flex: 1; }
.auth-note {
    margin-top: 16px;
    color: var(--auth-muted);
    font-size: 8px;
    line-height: 1.6;
}

.auth-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    max-width: calc(100vw - 36px);
    padding: 11px 14px;
    transform: translateY(15px);
    border-radius: 11px;
    background: #17191f;
    color: #fff;
    font-size: 9px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}
.auth-toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand-panel {
        min-height: auto;
        padding: 23px;
    }
    .auth-brand-copy { display: none; }
    .auth-brand-footer { display: none; }
    .auth-main { padding: 22px 14px 32px; }
    .auth-card { margin-top: -1px; }
}

@media (max-width: 520px) {
    .auth-card { padding: 23px 19px; border-radius: 18px; }
    .recovery-grid { grid-template-columns: 1fr; }
    .recovery-actions { flex-direction: column; }
    .secret-box { align-items: stretch; flex-direction: column; }
    .copy-mini { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Registration page */
.auth-page-register {
    grid-template-columns: minmax(320px, 0.78fr) minmax(610px, 1.22fr);
}
.auth-register-card { width: min(100%, 760px); }
.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.auth-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.auth-field-help {
    display: block;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 8px;
}
.auth-legal-consents {
    display: grid;
    gap: 12px;
    margin: 4px 0 18px;
}
.auth-consent {
    display: grid;
    grid-template-columns: 19px minmax(0, 1fr);
    align-items: flex-start;
    gap: 11px;
    padding: 14px 15px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fafbfd;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.55;
}
.auth-consent input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--auth-primary);
}
.auth-consent__content {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.auth-consent__text {
    cursor: pointer;
}
.auth-consent__link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    color: var(--auth-primary-dark);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.auth-consent__link:hover {
    color: #a75b00;
}
.auth-switch-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 17px;
    color: var(--auth-muted);
    font-size: 9px;
}
.auth-switch-panel a {
    color: var(--auth-primary-dark);
    font-weight: 800;
}
.auth-error-list {
    margin: 5px 0 0;
    padding-left: 16px;
}
.auth-benefits {
    display: grid;
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
}
.auth-benefits i {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 8px;
    background: rgba(245, 155, 35, 0.14);
    color: #ffc77e;
    font-size: 8px;
}
@media (max-width: 900px) {
    .auth-page-register { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-register-card { width: 100%; }
}

.auth-form-actions {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 13px;
}
.auth-utility-link {
    color: var(--auth-primary-dark);
    font-size: 9px;
    font-weight: 800;
}
.auth-utility-link:hover { text-decoration: underline; }
.auth-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.auth-field-hint {
    margin: -5px 0 15px !important;
    color: var(--auth-muted);
    font-size: 9px !important;
    line-height: 1.55 !important;
}
.auth-card-icon.success-icon {
    background: var(--auth-success-soft);
    color: var(--auth-success);
}
