/* Auth pages: login, register, verify, password reset / confirm */

:root {
    --auth-primary: #088dcd;
    --auth-primary-dark: #0670a3;
    --auth-primary-soft: #e6f4fb;
    --auth-text: #1c1e21;
    --auth-muted: #65676b;
    --auth-border: #d8dce2;
    --auth-bg: #f0f2f5;
    --auth-surface: #ffffff;
    --auth-danger: #d93025;
    --auth-success: #1e7e34;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.auth {
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- shell --- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    min-height: 100vh;
}

/* --- brand panel --- */

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    overflow: hidden;
    background: linear-gradient(150deg, #0a9ee6 0%, #0670a3 55%, #064c70 100%);
    color: #fff;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.auth-brand::before {
    width: 520px;
    height: 520px;
    right: -220px;
    top: -160px;
}

.auth-brand::after {
    width: 360px;
    height: 360px;
    left: -140px;
    bottom: -140px;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand__logo img {
    height: 44px;
    width: auto;
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
}

.auth-brand__copy {
    max-width: 440px;
}

.auth-brand__copy h1 {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.auth-brand__copy p {
    margin: 0 0 28px;
    font-size: 16px;
    opacity: .9;
}

.auth-brand__points {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-brand__points li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 500;
}

.auth-brand__points .fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
}

.auth-brand__foot {
    margin: 0;
    font-size: 13px;
    opacity: .7;
}

/* --- form panel --- */

.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-panel__logo {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    border-radius: 16px;
    background: var(--auth-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .06);
}

.auth-card__head {
    margin-bottom: 24px;
}

.auth-card__head--center {
    text-align: center;
}

.auth-card__head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-card__head p {
    margin: 0;
    color: var(--auth-muted);
}

.auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 24px;
}

/* --- fields --- */

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.auth-field__control {
    position: relative;
}

.auth-field__control input {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #fff;
    color: var(--auth-text);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.auth-field__control input::placeholder {
    color: #a0a4ab;
}

.auth-field__control input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(8, 141, 205, .18);
}

.auth-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    pointer-events: none;
}

.auth-field__icon + input {
    padding-left: 40px;
}

.auth-field__control input.has-toggle {
    padding-right: 44px;
}

.auth-field__toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9aa0a6;
    cursor: pointer;
}

.auth-field__toggle:hover,
.auth-field__toggle:focus-visible {
    color: var(--auth-text);
    background: var(--auth-bg);
    outline: none;
}

.auth-field__hint,
.auth-field__error {
    margin: 6px 0 0;
    font-size: 12px;
}

.auth-field__hint {
    color: var(--auth-muted);
}

.auth-field__error {
    color: var(--auth-danger);
    font-weight: 500;
}

.auth-field.has-error input {
    border-color: var(--auth-danger);
}

.auth-field.has-error input:focus {
    box-shadow: 0 0 0 3px rgba(217, 48, 37, .15);
}

/* --- checkbox, links, rows --- */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
}

.auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-check--terms {
    margin: 4px 0 20px;
}

.auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-row .auth-link {
    font-size: 14px;
}

.auth-switch {
    margin: 24px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--auth-muted);
}

/* --- buttons --- */

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: var(--auth-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.auth-btn:hover {
    background: var(--auth-primary-dark);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 141, 205, .35);
}

.auth-btn--secondary {
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

.auth-btn--secondary:hover {
    background: #d3ebf7;
}

.auth-btn.is-busy {
    opacity: .75;
    cursor: progress;
}

.auth-btn.is-busy::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

/* --- alerts --- */

.auth-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.auth-alert--success {
    background: #e7f6ec;
    color: var(--auth-success);
}

/* --- long documents (terms & conditions): full page, no card --- */

.auth--doc {
    background: var(--auth-surface);
}

.auth--doc .auth-shell {
    display: block;
    min-height: 100vh;
}

.auth--doc .auth-brand {
    display: none;
}

.auth--doc .auth-panel {
    display: block;
    padding: 0;
}

.auth--doc .auth-panel__logo {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    height: 64px;
    margin: 0;
    padding: 0 32px;
    border-bottom: 1px solid var(--auth-border);
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth--doc .auth-panel__logo img {
    height: 36px;
    width: auto;
}

.auth--doc .auth-card {
    max-width: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-doc {
    color: #3a3d42;
    font-size: 16px;
    line-height: 1.75;
}

.auth-doc__hero {
    padding: 56px 32px 48px;
    background: linear-gradient(150deg, #0a9ee6 0%, #0670a3 55%, #064c70 100%);
    color: #fff;
}

.auth-doc__hero-inner,
.auth-doc__body {
    max-width: 800px;
    margin: 0 auto;
}

.auth-doc__back,
.auth-doc__back:hover {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: #fff;
    font-size: 14px;
    opacity: .85;
}

.auth-doc__back:hover {
    opacity: 1;
}

.auth-doc__hero h1 {
    margin: 0 0 8px;
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.auth-doc__hero p {
    margin: 0;
    opacity: .85;
}

.auth-doc__body {
    padding: 48px 32px 80px;
}

.auth-doc h2,
.auth-doc h3 {
    margin: 40px 0 12px;
    color: var(--auth-text);
    font-size: 21px;
    letter-spacing: -.01em;
}

.auth-doc p {
    margin: 0 0 18px;
}

.auth-doc__foot {
    padding: 24px 32px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .auth--doc .auth-panel__logo {
        padding: 0 16px;
    }

    .auth-doc__hero {
        padding: 36px 16px 32px;
    }

    .auth-doc__hero h1 {
        font-size: 30px;
    }

    .auth-doc__body {
        padding: 32px 16px 56px;
    }
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* --- responsive --- */

@media (max-width: 960px) {
    .auth:not(.auth--doc) .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .auth:not(.auth--doc) .auth-panel {
        justify-content: flex-start;
        padding-top: 32px;
    }

    .auth:not(.auth--doc) .auth-panel__logo {
        display: block;
        margin-bottom: 24px;
    }

    .auth:not(.auth--doc) .auth-panel__logo img {
        height: 40px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .auth:not(.auth--doc) .auth-panel {
        padding: 24px 16px;
    }

    .auth:not(.auth--doc) .auth-card {
        padding: 24px 20px;
        border-radius: 14px;
    }

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

    .auth-row {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn.is-busy::after {
        animation-duration: 2s;
    }
}
