/* SelvaGo authentication flows. Shared by every view in resources/views/auth. */
.auth-page {
    width: min(100%, 680px);
    margin-inline: auto;
    padding: clamp(24px, 5vw, 64px) var(--sg-gutter) clamp(44px, 7vw, 80px);
}

.auth-page--wide {
    width: min(100%, 1040px);
}

.auth-card {
    position: relative;
    min-width: 0;
    padding: clamp(22px, 4vw, 40px);
    border: 1px solid var(--line);
    border-radius: var(--sg-radius-feature);
    background: #fff;
    box-shadow: 0 24px 60px -28px rgba(8, 37, 31, .2);
}

.auth-card--centered > :is(.auth-route, .auth-kicker, h1, .auth-intro) {
    margin-inline: auto;
    text-align: center;
}

.auth-route {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--forest-950);
    color: #EAF1ED;
    font: 500 11px/1.3 'DM Mono', monospace;
    letter-spacing: .07em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.auth-route-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--leaf);
}

.auth-route strong {
    color: var(--papaya);
}

.auth-kicker {
    width: max-content;
    max-width: 100%;
    margin: 0 0 9px;
    color: var(--papaya-dark);
    font: 600 11px/1.4 'DM Mono', monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin: 0;
    color: var(--forest-950);
    font: 700 clamp(28px, 4vw, 40px)/1 'Space Grotesk', sans-serif;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.auth-intro {
    max-width: 58ch;
    margin: 12px 0 26px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.auth-stack {
    display: grid;
    gap: 16px;
}

.auth-grid {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.auth-grid > *,
.auth-stack > *,
.auth-identity-control > * {
    min-width: 0;
}

.auth-grid--2,
.auth-grid--identity,
.auth-grid--store {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-grid--identity {
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
    align-items: start;
    gap: 16px;
}

.auth-grid--store {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
}

.auth-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.auth-card .sg-field {
    min-width: 0;
    align-content: start;
    text-align: left;
}

.auth-card .sg-field > label,
.auth-field-label {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.auth-card .sg-control {
    min-width: 0;
}

.auth-textarea {
    min-height: 110px;
    resize: vertical;
}

.auth-control--readonly {
    background: var(--surface-soft);
}

.auth-control--readonly.is-verified {
    border-color: #8EAF56;
    background: var(--success-soft);
}

.auth-identity-control {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.auth-identity-control .sg-button {
    min-width: 108px;
    padding-inline: 14px;
    white-space: nowrap;
}

.auth-verification-status {
    min-height: 17px;
    display: block;
    color: var(--text-muted);
    font: 600 11px/1.45 'Manrope', sans-serif;
}

.auth-verification-status:empty {
    visibility: hidden;
}

.auth-verification-status.is-success {
    color: #174B1B;
}

.auth-verification-status.is-error {
    color: var(--danger);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
    color: var(--text-muted);
    font: 600 10px 'DM Mono', monospace;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: '';
}

.auth-oauth {
    width: 100%;
    border-color: #BFC6CD;
    background: #fff;
    color: #1F1F1F;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.auth-oauth:hover {
    border-color: var(--forest-800);
    background: var(--surface-soft);
    color: #1F1F1F;
    box-shadow: 0 4px 14px rgba(8, 37, 31, .08);
}

.auth-oauth svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.auth-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-help a,
.auth-foot a {
    color: var(--papaya-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.auth-check,
.password-visibility {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.password-visibility {
    justify-self: center;
}

.auth-check input,
.password-visibility input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 0;
    accent-color: var(--papaya-dark);
}

.auth-foot {
    margin: 22px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.auth-note {
    margin: 0;
    color: var(--text-muted);
    font: 500 11px/1.55 'DM Mono', monospace;
}

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

.auth-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.auth-card .sg-button {
    width: 100%;
}

.auth-card > .sg-alert {
    margin-bottom: 16px;
}

.auth-card > .auth-oauth + .auth-divider {
    margin-block: 20px;
}

.auth-alert-list {
    margin: 4px 0 0;
    padding-left: 18px;
}

.auth-alert-list li + li {
    margin-top: 3px;
}

.auth-error-summary:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.auth-steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin: 18px 0 28px;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font: 600 10px 'DM Mono', monospace;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-step {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.auth-step b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 50%;
    background: #E6E0D4;
    color: var(--forest-800);
}

.auth-step.is-current {
    border-color: #C95A32;
    background: #FFF6F1;
    color: var(--papaya-dark);
}

.auth-step.is-current b {
    background: var(--papaya);
    color: var(--forest-950);
}

.auth-role-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.auth-role-fieldset legend {
    width: 100%;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.auth-role-list {
    display: grid;
    gap: 12px;
}

.auth-role-option {
    min-width: 0;
    min-height: 74px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-role-option:hover,
.auth-role-option:focus-within {
    border-color: var(--focus-ring);
    background: #FFF7F2;
    box-shadow: 0 8px 20px rgba(8, 37, 31, .05);
}

.auth-role-option input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--papaya-dark);
}

.auth-role-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 14px;
    background: #EAF0E6;
    color: var(--forest-800);
    font-size: 20px;
}

.auth-role-copy {
    min-width: 0;
}

.auth-role-copy strong {
    display: block;
    color: var(--forest-950);
    font: 600 17px 'Space Grotesk', sans-serif;
}

.auth-role-copy span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-stage-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 0;
    color: var(--forest-950);
    font: 700 16px 'Space Grotesk', sans-serif;
    text-align: left;
}

.auth-stage-title b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--forest-950);
    color: #fff;
    font: 600 11px 'DM Mono', monospace;
}

.auth-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid #C9D7C2;
    border-radius: 14px;
    background: #EEF3E9;
    color: var(--forest-800);
    font-size: 12px;
    line-height: 1.55;
    text-align: left;
}

.auth-privacy-note strong {
    display: block;
    margin-bottom: 2px;
}

.auth-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.auth-upload-grid.is-bicycle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-upload-card {
    min-width: 0;
    min-height: 142px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    overflow: hidden;
    border: 1.5px dashed #CFC5B8;
    border-radius: 16px;
    background: #FFFBF7;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}

.auth-upload-card:hover,
.auth-upload-card:focus-within {
    border-color: var(--focus-ring);
    background: #FFF7F2;
}

.auth-upload-card:focus-within {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.auth-upload-card.has-file {
    border-style: solid;
    border-color: #8EAF56;
    background: var(--success-soft);
}

.auth-upload-card.has-error {
    border-style: solid;
    border-color: var(--danger);
    background: var(--danger-soft);
}

.auth-visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
    font-size: 22px;
}

.auth-upload-card strong,
.auth-upload-file {
    width: 100%;
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-upload-card strong {
    color: var(--ink);
    font-size: 11px;
    line-height: 1.25;
}

.auth-upload-hint {
    color: var(--text-muted);
    font: 500 10px 'DM Mono', monospace;
}

.auth-upload-file {
    color: var(--forest-800);
    font-size: 11px;
    font-weight: 700;
}

.auth-upload-card.has-error .auth-upload-file {
    color: var(--danger);
}

@media (max-width: 900px) {
    .auth-grid--3,
    .auth-upload-grid,
    .auth-upload-grid.is-bicycle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .auth-page,
    .auth-page--wide {
        width: 100%;
        padding-top: 24px;
    }

    .auth-grid--2,
    .auth-grid--3,
    .auth-grid--identity,
    .auth-grid--store {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-upload-grid,
    .auth-upload-grid.is-bicycle {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .auth-card {
        padding: 20px 16px;
        border-radius: 22px;
    }

    .auth-identity-control,
    .auth-action-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-identity-control .sg-button {
        min-width: 0;
    }

    .auth-help {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding-inline: 14px;
    }

    .auth-route {
        font-size: 10px;
    }
}

@media (max-height: 820px) and (min-width: 800px) {
    .auth-page {
        padding-block: 28px 44px;
    }
}
