/* Portal auth — portal-front.pen frames 29–31 */
.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(280px, 560px) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 48px;
    background: #1A1F26;
    color: #F8FAFC;
}

.auth-brand-panel__top {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.auth-brand-panel__logo .portal-logo__text {
    color: #F8FAFC;
    font-size: 1.1rem;
    font-weight: 700;
}

.auth-brand-panel__logo .portal-logo__mark:not(.portal-logo__mark--image) {
    background: var(--primary);
}

.auth-brand-panel__logo .portal-logo__search {
    display: none;
}

.auth-brand-panel__logo .portal-logo {
    gap: 0;
}

.auth-brand-panel__logo .portal-logo__brand {
    pointer-events: none;
}

.auth-brand-panel__hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-brand-panel__hero h2 {
    margin: 0;
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    color: #F8FAFC;
}

.auth-brand-panel__hero p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #94A3B8;
}

.auth-brand-panel__features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
}

.auth-brand-panel__feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #94A3B8;
}

.auth-brand-panel__feature-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #2A3038;
    color: var(--primary);
    flex-shrink: 0;
}

.auth-brand-panel__feature-icon svg {
    width: 16px;
    height: 16px;
}

.auth-brand-panel__copy {
    margin: 0;
    font-size: 12px;
    color: #94A3B8;
}

.auth-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--bg-page);
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-shell--wide {
    max-width: 480px;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.auth-card--compact {
    gap: 22px;
    padding: 36px;
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.auth-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-fields--tight {
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field--tight {
    gap: 6px;
}

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

.auth-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-link--muted {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    cursor: default;
}

.auth-input {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 0 12px;
    min-height: 44px;
    overflow: hidden;
    background: var(--bg-subtle, #EEF2F7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    cursor: text;
}

.auth-input:focus-within {
    border-color: #64748B;
    box-shadow: 0 0 0 3px color-mix(in srgb, #64748B 22%, transparent);
}

.auth-input.is-invalid,
.auth-field.has-error .auth-input {
    border-color: var(--primary);
}

.auth-input.is-invalid:focus-within,
.auth-field.has-error .auth-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.auth-field-error[hidden] {
    display: none;
}

.auth-input__icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    align-self: center;
}

.auth-input input {
    flex: 1 1 auto;
    align-self: stretch;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    background-image: none;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
}

.auth-input input::placeholder {
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    opacity: 1;
}

/* Chrome/Edge/Safari autofill — no blue strip inside the field */
.auth-input input:-webkit-autofill,
.auth-input input:-webkit-autofill:hover,
.auth-input input:-webkit-autofill:focus,
.auth-input input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-subtle, #EEF2F7) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-subtle, #EEF2F7) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
    border: none !important;
    border-radius: 0 !important;
    transition: background-color 99999s ease-out 0s;
    background-color: var(--bg-subtle, #EEF2F7) !important;
    background-clip: content-box !important;
}

.auth-input__toggle {
    display: grid;
    place-items: center;
    align-self: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-input__toggle:hover {
    color: var(--text-primary);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: var(--radius-sm, 6px);
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}

.auth-submit:hover {
    filter: brightness(1.05);
    text-decoration: none;
    color: #fff;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm, 6px);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    font-size: 13px;
}

.auth-field-error {
    margin: 0;
    font-size: 12px;
    color: var(--primary);
}

.auth-success-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 16px;
    background: color-mix(in srgb, #16A34A 12%, transparent);
    color: #16A34A;
}

.auth-note {
    margin: 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.auth-modal {
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg, 14px);
    background: transparent;
    max-width: calc(100vw - 32px);
    width: 400px;
}

.auth-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.auth-modal__card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.auth-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.auth-modal__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.auth-modal__close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-modal__close:hover {
    background: var(--bg-subtle, #F8FAFC);
    color: var(--text-primary);
}

.auth-modal__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

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

    .auth-brand-panel {
        padding: 32px 24px 24px;
        min-height: auto;
    }

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

    .auth-brand-panel__hero h2 {
        font-size: 1.5rem;
    }

    .auth-form-area {
        padding: 24px 16px 48px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 28px 24px;
    }
}
