/*
 * Split-screen authentication pages.
 *
 * Grid, not flex, so the two panels stay exactly 1fr each on desktop and the
 * brand panel can be removed from the flow entirely on small screens.
 */

.auth-body {
    margin: 0;
    background: var(--surface);
}

.auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

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

.auth__brand {
    position: relative;
    display: flex;
    align-items: center;
    padding: 3rem;
    color: #f5f7fb;
    background:
        radial-gradient(1000px 500px at 15% 10%, color-mix(in srgb, var(--brand-primary) 28%, transparent), transparent 60%),
        linear-gradient(145deg, #050814 0%, #0c1224 55%, #070b16 100%);
    overflow: hidden;
}

/* Soft grid texture so the panel is not a flat gradient. */
.auth__brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.auth__brand-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.auth__logo {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 3.5rem;
}

.auth__logo-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgb(255 255 255 / 14%);
    border: 1px solid rgb(255 255 255 / 22%);
    font-size: .85rem;
    letter-spacing: .03em;
}

.auth__pitch-title {
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    line-height: 1.18;
    margin: 0 0 .9rem;
}

.auth__pitch-body {
    margin: 0 0 2.25rem;
    color: rgb(255 255 255 / 78%);
    font-size: 1.02rem;
}

.auth__points {
    list-style: none;
    margin: 0 0 3rem;
    padding: 0;
    display: grid;
    gap: .85rem;
}

.auth__points li {
    position: relative;
    padding-left: 1.9rem;
    color: rgb(255 255 255 / 86%);
    font-size: .95rem;
}

.auth__points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45rem;
    width: 1.1rem;
    height: .6rem;
    border-left: 2px solid var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    transform: rotate(-45deg);
}

.auth__brand-foot a {
    color: rgb(255 255 255 / 70%);
    text-decoration: none;
    font-size: .92rem;
}

.auth__brand-foot a:hover {
    color: #fff;
}

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

.auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: #fff;
    color: var(--ink);
}

.auth__panel-inner {
    width: 100%;
    max-width: 400px;
}

.auth__mobile-logo {
    display: none;
    align-items: center;
    gap: .6rem;
    margin-bottom: 2rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.auth__mobile-logo .auth__logo-mark {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-color: transparent;
    color: #fff;
    width: 34px;
    height: 34px;
}

.auth__header {
    margin-bottom: 1.75rem;
}

.auth__title {
    margin: 0 0 .35rem;
    font-size: 1.65rem;
}

.auth__subtitle {
    margin: 0;
    color: var(--ink-muted);
    font-size: .94rem;
}

.auth__divider {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 1.5rem 0;
    color: var(--ink-muted);
    font-size: .82rem;
}

.auth__divider::before,
.auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth__foot {
    margin-top: 1.75rem;
    color: var(--ink-muted);
    font-size: .83rem;
    text-align: center;
}

/* ------------------------------------------------------------- fields */

.field {
    margin-bottom: 1.15rem;
}

.field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.field__label {
    display: block;
    margin-bottom: .4rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.field__aside {
    font-size: .82rem;
    text-decoration: none;
}

.field__aside:hover {
    text-decoration: underline;
}

.field__group {
    position: relative;
    display: flex;
}

.field__input {
    width: 100%;
    padding: .7rem .85rem;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field__input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgb(29 78 216 / 14%);
}

.field__input.is-invalid {
    border-color: #dc2626;
}

.field__input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgb(220 38 38 / 14%);
}

.field__group .field__input {
    padding-right: 4.2rem;
}

.field__toggle {
    position: absolute;
    right: .4rem;
    top: 50%;
    transform: translateY(-50%);
    padding: .3rem .55rem;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.field__toggle:hover {
    color: var(--brand-primary);
    background: var(--surface-alt);
}

.field__error {
    margin: .4rem 0 0;
    font-size: .83rem;
    color: #dc2626;
}

.field__hint {
    margin: .4rem 0 0;
    font-size: .82rem;
    color: var(--ink-muted);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1.35rem;
    font-size: .88rem;
    color: var(--ink-soft);
    cursor: pointer;
}

.checkbox input {
    margin-top: .2rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.btn-block {
    width: 100%;
}

/* --------------------------------------------------- Google button */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    padding: .7rem 1rem;
    font-size: .95rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    background: #fff;
    border: 1px solid #d5dae2;
    border-radius: var(--radius-sm);
    transition: background-color .15s ease, box-shadow .15s ease;
}

.btn-google:hover {
    background: #f7f9fc;
    box-shadow: var(--shadow-sm);
}

.btn-google__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ------------------------------------------------- password strength */

.strength {
    margin-top: .55rem;
}

.strength__bar {
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.strength__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #dc2626;
    transition: width .2s ease, background-color .2s ease;
}

.strength__label {
    margin: .35rem 0 0;
    font-size: .78rem;
    color: var(--ink-muted);
}

.strength[data-level="2"] .strength__fill { width: 50%; background: #f59e0b; }
.strength[data-level="3"] .strength__fill { width: 75%; background: #10b981; }
.strength[data-level="4"] .strength__fill { width: 100%; background: #059669; }
.strength[data-level="1"] .strength__fill { width: 25%; background: #dc2626; }

/* ------------------------------------------------------------ alerts */

.alert {
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    border: 1px solid transparent;
}

.alert--success {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.alert--error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.alert--info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* -------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__brand {
        display: none;
    }

    .auth__mobile-logo {
        display: inline-flex;
    }

    .auth__panel {
        align-items: flex-start;
        padding: 2.5rem 1.5rem;
    }
}

/* Auth mobile polish */
@media (max-width: 900px) {
    .auth__panel {
        padding: 1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .auth__panel-inner {
        width: 100%;
        max-width: 100%;
    }

    .auth input[type="text"],
    .auth input[type="email"],
    .auth input[type="password"],
    .auth select,
    .auth textarea {
        font-size: 16px !important;
        min-height: 2.75rem;
    }

    .auth .btn,
    .auth button[type="submit"] {
        min-height: 2.75rem;
        width: 100%;
        touch-action: manipulation;
    }
}
