/* Sign-in pages (login, signup, verify, accept-invite, forgot/reset password): a 45/55 split
   with a dark brand panel (CSS geometry, no photo) and the form. Uses the tokens in styles.css. */

body.auth main {
    display: block;
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 100vh;
}

/* ---------- Brand panel ---------- */

.auth-art {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-8);
    overflow: hidden;
    padding: var(--space-12);
    background: var(--color-art-bg);
    color: var(--color-art-text);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-art-text);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.025em;
    text-decoration: none;
}

/* The company logo, in the panel's text colour. */
.auth-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
    fill: currentColor;
}

a.auth-brand:hover {
    color: var(--color-art-text);
}

.auth-brand small {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--color-art-muted);
}

/* Three rotated outlines. */
.art {
    position: relative;
    display: grid;
    place-items: center;
    height: 330px;
}

.art span {
    position: absolute;
    width: 280px;
    height: 280px;
    border: 1px solid var(--color-art-line);
    border-radius: 32px;
    transform: rotate(-15deg);
}

.art span:nth-child(2) {
    width: 230px;
    height: 230px;
    transform: rotate(15deg);
}

.art span:nth-child(3) {
    width: 180px;
    height: 180px;
    transform: rotate(45deg);
}

.auth-tagline h2 {
    max-width: 380px;
    font-size: var(--text-2xl);
    font-weight: 500;
    line-height: 1.2;
}

.auth-tagline p {
    max-width: 390px;
    margin-top: var(--space-3);
    color: var(--color-art-muted);
}

/* ---------- Form panel ---------- */

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-16) max(var(--space-16), calc((100% - 400px) / 2));
}

.auth-panel h1 {
    margin-bottom: var(--space-2);
}

.auth-sub {
    margin: 0 0 var(--space-8);
    color: var(--color-text-secondary);
}

.auth-foot {
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.auth-panel .error,
.auth-panel .success {
    margin-bottom: var(--space-6);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-4);
}

/* Password with a Show / Hide text button inside the field (auth.js). */
.pw-field {
    position: relative;
}

.pw-field input {
    padding-inline-end: 76px !important;
}

.pw-toggle {
    position: absolute;
    top: 2px;
    inset-inline-end: 4px;
    min-width: 64px;
    padding: 0 8px;
    background: none;
    border: 0;
    color: var(--color-accent);
    font-weight: 600;
}

.pw-toggle:hover {
    background: none;
    color: var(--color-accent-hover);
}

.forgot-link {
    margin: calc(var(--space-5) * -1 + var(--space-2)) 0 var(--space-5);
    font-size: var(--text-sm);
}

.forgot-link a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.auth-panel button[type="submit"] {
    width: 100%;
}

/* Secondary action under an error (Resend verification email). */
.btn-secondary {
    width: 100%;
    margin-bottom: var(--space-6);
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-control-border);
}

.btn-secondary:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

/* "Go to login" link shown after success; scripts show it with display: grid. */
a.btn-primary {
    min-height: 44px;
    padding: 11px 18px;
    border-radius: var(--radius-control);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    place-items: center;
}

a.btn-primary:hover {
    background: var(--color-accent-hover);
    color: var(--color-on-accent);
}

/* ---------- Phones: the brand panel becomes a compact header ---------- */

@media (max-width: 760px) {
    .auth-shell {
        display: block;
    }

    .auth-art {
        gap: var(--space-6);
        padding: var(--space-6);
    }

    .art {
        display: none;
    }

    .auth-tagline h2 {
        font-size: var(--text-xl);
    }

    .auth-tagline p {
        font-size: var(--text-sm);
    }

    .auth-panel {
        padding: var(--space-8) var(--space-6) var(--space-12);
    }

    .auth-sub {
        margin-bottom: var(--space-6);
    }
}

@media (max-width: 380px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}
