/* Account shell: 440px auth card centered on a full-bleed photo; errors stay a plain card. */

.account-shell {
    display: grid;
    flex: 1;
    min-height: 0;
}

.account-visual {
    display: none;
    position: relative;
    overflow: hidden;
    background: var(--color-media);
}

.account-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.85) contrast(1.05);
}

.account-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 21, 24, 0.25), rgba(8, 107, 91, 0.58));
}

.account-visual-copy {
    display: none;
}

.account-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.account-bar {
    width: 100%;
    padding: var(--space-5) var(--space-5) var(--space-2);
}

.account-bar .brand {
    text-decoration: none;
}

.auth-page .eyebrow {
    margin: 0 0 var(--space-2);
}

.auth-page h1 {
    margin: 0 0 var(--space-3);
    font-family: var(--font-sans);
    font-size: clamp(2rem, 4vw, 2.75rem);
    letter-spacing: -.045em;
}

.auth-lead {
    color: var(--color-text-muted);
    margin: 0 0 var(--space-5);
}

.auth-steps {
    list-style: none;
    margin: 0 0 var(--space-5);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
    counter-reset: auth-step;
}

.auth-steps li {
    display: flex;
    gap: var(--space-2);
    align-items: baseline;
    counter-increment: auth-step;
}

.auth-steps li::before {
    content: counter(auth-step, decimal-leading-zero);
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent);
}

.auth-page form .ui-button-primary {
    width: 100%;
    margin-top: var(--space-2);
}

body.layout-card main {
    align-self: center;
    width: calc(100% - var(--space-6));
    max-width: 42rem;
    margin: var(--space-5) auto;
    padding: clamp(var(--space-5), 5vw, 3.5rem);
    padding-bottom: max(clamp(var(--space-5), 5vw, 3.5rem), calc(env(safe-area-inset-bottom, 0px) + var(--space-5)));
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-dialog);
    box-shadow: var(--shadow-raised);
}

body.layout-card main:has(.auth-page) {
    width: 100%;
    max-width: var(--measure-auth);
    margin: 0 auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-raised);
    background: var(--color-surface);
    padding: clamp(var(--space-5), 4vw, var(--space-6));
    padding-bottom: max(clamp(var(--space-5), 4vw, var(--space-6)), calc(env(safe-area-inset-bottom, 0px) + var(--space-5)));
}

.auth-page .auth-links {
    margin-top: var(--space-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
}

.profile-section {
    margin: var(--space-6) 0;
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.profile-section h2 {
    font-size: var(--font-size-prose);
}

.profile-danger {
    padding: var(--space-5);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-card);
    background: var(--color-danger-soft);
}

.profile-page .theme-control {
    margin-left: 0;
    max-width: none;
}

.error-page .error-code {
    margin-bottom: var(--space-3);
    color: var(--color-accent);
    font-weight: var(--font-weight-bold);
    letter-spacing: .12em;
    font-size: var(--font-size-label);
}

.dev-login .ui-button,
.dev-login-actions .ui-button {
    width: auto;
}

body.layout-card .site-footer {
    background: transparent;
    border-top: 0;
}

body.layout-card:has(.auth-page) {
    position: relative;
}

body.layout-card:has(.auth-page) .account-visual {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
}

body.layout-card:has(.auth-page) .account-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: var(--space-6) var(--space-4);
}

body.layout-card:has(.auth-page) .account-panel {
    position: relative;
    z-index: 1;
    width: min(var(--measure-auth), 100%);
    align-items: stretch;
    margin-block: auto;
}

body.layout-card:has(.auth-page) .account-bar {
    display: flex;
    justify-content: center;
    padding: 0 0 var(--space-4);
}

body.layout-card:has(.auth-page) .account-bar .brand {
    color: #f4f7f6;
}

body.layout-card:has(.auth-page) .account-bar .brand:hover {
    color: #f4f7f6;
}

body.layout-card:has(.auth-page) .account-bar .brand-mark {
    color: var(--color-accent);
}

body.layout-card:has(.auth-page) .site-footer {
    position: relative;
    z-index: 1;
}

body.layout-card:has(.auth-page) .footer-copy {
    color: #f4f7f6;
}
