/* ==========================================================================
   AluminiumGlass User App
   Authentication Styles
   File: /user_app/assets/css/auth.css
   ========================================================================== */

/* ==========================================================================
   AUTH PAGE
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-background, #f5f7fa);
    color: var(--color-text, #1f2937);
}

.auth-main {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-main-start {
    align-items: flex-start;
}

.auth-main-end {
    align-items: flex-end;
}

/* ==========================================================================
   AUTH CONTAINER
   ========================================================================== */

.auth-container {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
}

.auth-container-sm {
    max-width: 26rem;
}

.auth-container-md {
    max-width: 32rem;
}

.auth-container-lg {
    max-width: 42rem;
}

.auth-container-xl {
    max-width: 60rem;
}

/* ==========================================================================
   AUTH CARD
   ========================================================================== */

.auth-card {
    width: 100%;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-lg, 0.875rem);
    box-shadow: var(
        --shadow-lg,
        0 10px 30px rgba(15, 23, 42, 0.08)
    );
    overflow: hidden;
}

.auth-card-flat {
    box-shadow: none;
}

.auth-card-borderless {
    border: 0;
}

.auth-card-compact .auth-body {
    padding: 1.5rem;
}

.auth-card-spacious .auth-body {
    padding: 2.5rem;
}

/* ==========================================================================
   AUTH HEADER
   ========================================================================== */

.auth-header {
    width: 100%;
    text-align: center;
    padding: 2rem 2rem 0;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    text-decoration: none;
    color: inherit;
}

.auth-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 3rem;
    object-fit: contain;
}

.auth-logo-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: var(--color-primary, #2563eb);
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

.auth-title {
    margin: 0;
    color: var(--color-heading, #111827);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    line-height: 1.25;
}

.auth-subtitle {
    max-width: 34rem;
    margin: 0.625rem auto 0;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ==========================================================================
   AUTH BODY
   ========================================================================== */

.auth-body {
    width: 100%;
    padding: 2rem;
}

.auth-description {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* ==========================================================================
   AUTH FORM
   ========================================================================== */

.auth-form {
    width: 100%;
}

.auth-form .form-group {
    margin-bottom: 1.125rem;
}

.auth-form .form-actions {
    margin-top: 1.5rem;
}

/* ==========================================================================
   AUTH FIELD
   ========================================================================== */

.auth-field {
    width: 100%;
    margin: 0 0 1.125rem;
}

.auth-field:last-child {
    margin-bottom: 0;
}

.auth-field label {
    display: block;
    margin: 0 0 0.5rem;
    color: var(--color-text, #374151);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.auth-field .required {
    margin-left: 0.125rem;
    color: var(--color-danger, #dc2626);
}

/* ==========================================================================
   AUTH INPUT
   ========================================================================== */

.auth-input {
    display: block;
    width: 100%;
    min-height: 2.875rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    outline: none;
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #111827);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--color-text-placeholder, #9ca3af);
    opacity: 1;
}

.auth-input:hover {
    border-color: var(--color-border-hover, #9ca3af);
}

.auth-input:focus {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px
        var(--color-primary-soft, rgba(37, 99, 235, 0.12));
}

.auth-input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    background: var(--color-background-muted, #f3f4f6);
}

.auth-input[readonly] {
    cursor: default;
    background: var(--color-background-muted, #f9fafb);
}

.auth-input.is-invalid,
.auth-input[aria-invalid="true"] {
    border-color: var(--color-danger, #dc2626);
}

.auth-input.is-invalid:focus,
.auth-input[aria-invalid="true"]:focus {
    border-color: var(--color-danger, #dc2626);
    box-shadow: 0 0 0 3px
        var(--color-danger-soft, rgba(220, 38, 38, 0.12));
}

.auth-input.is-valid,
.auth-input[aria-invalid="false"] {
    border-color: var(--color-success, #16a34a);
}

.auth-input.is-valid:focus,
.auth-input[aria-invalid="false"]:focus {
    border-color: var(--color-success, #16a34a);
    box-shadow: 0 0 0 3px
        var(--color-success-soft, rgba(22, 163, 74, 0.12));
}

/* ==========================================================================
   INPUT WRAPPER / ICON
   ========================================================================== */

.auth-input-wrapper {
    position: relative;
    width: 100%;
}

.auth-input-wrapper .auth-input {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    z-index: 2;
    width: 1.125rem;
    height: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted, #9ca3af);
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-input-wrapper:has(.auth-input-icon) .auth-input {
    padding-left: 2.75rem;
}

/* ==========================================================================
   PASSWORD
   ========================================================================== */

.auth-password {
    position: relative;
}

.auth-password .auth-input {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    z-index: 3;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-text-muted, #6b7280);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.auth-password-toggle:hover {
    background: var(--color-background-muted, #f3f4f6);
    color: var(--color-text, #111827);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

.auth-password-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.auth-password-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ==========================================================================
   HELP / ERROR / SUCCESS
   ========================================================================== */

.auth-help {
    display: block;
    margin-top: 0.375rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-error {
    display: block;
    margin-top: 0.375rem;
    color: var(--color-danger, #dc2626);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-success {
    display: block;
    margin-top: 0.375rem;
    color: var(--color-success, #16a34a);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ==========================================================================
   OPTIONS
   ========================================================================== */

.auth-options {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.25rem 0 1.25rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
    line-height: 1.4;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-primary, #2563eb);
}

.auth-forgot {
    color: var(--color-primary, #2563eb);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

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

/* ==========================================================================
   SUBMIT
   ========================================================================== */

.auth-submit {
    position: relative;
    width: 100%;
    min-height: 2.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-primary, #2563eb);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease,
        opacity 160ms ease;
    box-sizing: border-box;
}

.auth-submit:hover {
    background: var(--color-primary-hover, #1d4ed8);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px
        var(--color-primary-soft, rgba(37, 99, 235, 0.14));
}

.auth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.auth-submit.loading {
    cursor: wait;
}

.auth-submit-spinner {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   SECONDARY ACTION
   ========================================================================== */

.auth-secondary-action {
    width: 100%;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #374151);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease;
    box-sizing: border-box;
}

.auth-secondary-action:hover {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-background-muted, #f9fafb);
    color: var(--color-primary, #2563eb);
}

/* ==========================================================================
   DIVIDER
   ========================================================================== */

.auth-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted, #9ca3af);
    font-size: 0.8125rem;
    line-height: 1;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--color-border, #e5e7eb);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.auth-footer {
    width: 100%;
    padding: 0 2rem 2rem;
    text-align: center;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
    line-height: 1.6;
}

.auth-footer a {
    color: var(--color-primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   REGISTER
   ========================================================================== */

.auth-register .auth-card {
    max-width: 100%;
}

.auth-register-form {
    width: 100%;
}

.auth-register-form .auth-field-full {
    grid-column: 1 / -1;
}

.auth-register-form .auth-submit-wrapper {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
}

.auth-register-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
}

.auth-register-form > .auth-field,
.auth-register-form > .auth-form-group {
    min-width: 0;
}

.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 0 0 1.25rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    line-height: 1.55;
}

.auth-consent input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin: 0.125rem 0 0;
    accent-color: var(--color-primary, #2563eb);
}

.auth-consent a {
    color: var(--color-primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.auth-consent a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PASSWORD STRENGTH
   ========================================================================== */

.password-strength {
    width: 100%;
    margin-top: 0.625rem;
}

.password-strength-bar {
    width: 100%;
    display: flex;
    gap: 0.25rem;
}

.password-strength-segment {
    flex: 1 1 0;
    height: 0.25rem;
    border-radius: 999px;
    background: var(--color-border, #e5e7eb);
    transition: background-color 160ms ease;
}

.password-strength.weak
    .password-strength-segment:nth-child(-n + 1) {
    background: var(--color-danger, #dc2626);
}

.password-strength.medium
    .password-strength-segment:nth-child(-n + 2) {
    background: var(--color-warning, #d97706);
}

.password-strength.strong
    .password-strength-segment:nth-child(-n + 3) {
    background: var(--color-success, #16a34a);
}

.password-strength.very-strong
    .password-strength-segment:nth-child(-n + 4) {
    background: var(--color-success, #15803d);
}

.password-strength-label {
    display: block;
    margin-top: 0.375rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ==========================================================================
   PASSWORD REQUIREMENTS
   ========================================================================== */

.password-requirements {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.password-requirement {
    position: relative;
    padding-left: 1.25rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.75rem;
    line-height: 1.7;
}

.password-requirement::before {
    content: "○";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-text-muted, #9ca3af);
}

.password-requirement.is-met {
    color: var(--color-success, #16a34a);
}

.password-requirement.is-met::before {
    content: "✓";
    color: var(--color-success, #16a34a);
}

/* ==========================================================================
   VERIFICATION
   ========================================================================== */

.auth-verification {
    width: 100%;
    text-align: center;
}

.auth-verification-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--color-primary-soft, rgba(37, 99, 235, 0.1));
    color: var(--color-primary, #2563eb);
}

.auth-verification-icon svg {
    width: 2rem;
    height: 2rem;
}

.auth-verification-message {
    margin: 0;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.auth-verification-target {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-heading, #111827);
    font-weight: 600;
    word-break: break-word;
}

/* ==========================================================================
   OTP
   ========================================================================== */

.otp-container {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    margin: 1.25rem 0;
}

.otp-input {
    width: 3rem;
    height: 3.25rem;
    flex: 0 0 3rem;
    padding: 0;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-surface, #ffffff);
    color: var(--color-heading, #111827);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    outline: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
    box-sizing: border-box;
}

.otp-input:focus {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px
        var(--color-primary-soft, rgba(37, 99, 235, 0.12));
}

.otp-resend {
    margin-top: 1rem;
    text-align: center;
}

.otp-resend-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-primary, #2563eb);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.otp-resend-button:hover {
    text-decoration: underline;
}

.otp-resend-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    text-decoration: none;
}

.otp-timer {
    margin-top: 0.5rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    text-align: center;
}

.otp-timer-value {
    color: var(--color-text, #374151);
    font-weight: 600;
}

/* ==========================================================================
   TWO FACTOR AUTHENTICATION
   ========================================================================== */

.auth-2fa .auth-card {
    max-width: 100%;
}

.auth-2fa-methods {
    width: 100%;
    display: grid;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.auth-2fa-method {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-surface, #ffffff);
    text-align: left;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
    box-sizing: border-box;
}

.auth-2fa-method:hover {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-background-muted, #f9fafb);
}

.auth-2fa-method.selected,
.auth-2fa-method[aria-selected="true"] {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-primary-soft, rgba(37, 99, 235, 0.06));
    box-shadow: 0 0 0 1px var(--color-primary, #2563eb);
}

.auth-2fa-method-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: var(--color-background-muted, #f3f4f6);
    color: var(--color-primary, #2563eb);
}

.auth-2fa-method-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-2fa-method-content {
    min-width: 0;
    flex: 1 1 auto;
}

.auth-2fa-method-title {
    margin: 0;
    color: var(--color-heading, #111827);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.auth-2fa-method-description {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ==========================================================================
   BACKUP CODE
   ========================================================================== */

.auth-backup-code {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px dashed var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-background-muted, #f9fafb);
    color: var(--color-heading, #111827);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.6;
    text-align: center;
    word-break: break-all;
}

/* ==========================================================================
   RECOVERY
   ========================================================================== */

.auth-recovery-message {
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-background-muted, #f9fafb);
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
    line-height: 1.6;
    box-sizing: border-box;
}

/* ==========================================================================
   LOGOUT
   ========================================================================== */

.auth-logout {
    width: 100%;
    text-align: center;
}

.auth-logout-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--color-background-muted, #f3f4f6);
    color: var(--color-text-muted, #6b7280);
}

.auth-logout-icon svg {
    width: 2rem;
    height: 2rem;
}

.auth-logout-message {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* ==========================================================================
   AUTH ALERT
   ========================================================================== */

.auth-alert {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-background-muted, #f9fafb);
    color: var(--color-text, #374151);
    font-size: 0.875rem;
    line-height: 1.55;
    box-sizing: border-box;
}

.auth-alert-success {
    border-color: var(--color-success-border, #bbf7d0);
    background: var(--color-success-soft, #f0fdf4);
    color: var(--color-success-text, #166534);
}

.auth-alert-error {
    border-color: var(--color-danger-border, #fecaca);
    background: var(--color-danger-soft, #fef2f2);
    color: var(--color-danger-text, #991b1b);
}

.auth-alert-warning {
    border-color: var(--color-warning-border, #fed7aa);
    background: var(--color-warning-soft, #fff7ed);
    color: var(--color-warning-text, #9a3412);
}

.auth-alert-info {
    border-color: var(--color-info-border, #bfdbfe);
    background: var(--color-info-soft, #eff6ff);
    color: var(--color-info-text, #1e40af);
}

/* ==========================================================================
   AUTH STEPS
   ========================================================================== */

.auth-steps {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 0 2rem;
}

.auth-step {
    position: relative;
    flex: 1 1 0;
    max-width: 10rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-step-number {
    position: relative;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 50%;
    background: var(--color-surface, #ffffff);
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    font-weight: 700;
}

.auth-step.active .auth-step-number {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-primary, #2563eb);
    color: #ffffff;
}

.auth-step.complete .auth-step-number {
    border-color: var(--color-success, #16a34a);
    background: var(--color-success, #16a34a);
    color: #ffffff;
}

.auth-step-line {
    position: absolute;
    top: 1rem;
    left: 50%;
    width: 100%;
    height: 1px;
    background: var(--color-border, #e5e7eb);
    z-index: 1;
}

.auth-step:last-child .auth-step-line {
    display: none;
}

.auth-step.complete .auth-step-line {
    background: var(--color-success, #16a34a);
}

/* ==========================================================================
   BACK
   ========================================================================== */

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--color-primary, #2563eb);
}

.auth-back svg {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   SECURITY NOTE
   ========================================================================== */

.auth-security-note {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-background-muted, #f9fafb);
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8125rem;
    line-height: 1.55;
    box-sizing: border-box;
}

.auth-security-note-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 1.125rem;
    color: var(--color-primary, #2563eb);
}

.auth-security-note-icon svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   LOADING
   ========================================================================== */

.auth-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.auth-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.auth-loading-indicator {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    border: 2px solid var(--color-border, #d1d5db);
    border-top-color: var(--color-primary, #2563eb);
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

/* ==========================================================================
   SPLIT AUTH LAYOUT
   ========================================================================== */

.auth-split {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-split-content {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-split-panel {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-primary, #2563eb);
    color: #ffffff;
}

.auth-split-panel-content {
    width: 100%;
    max-width: 34rem;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible,
.auth-page select:focus-visible,
.auth-page textarea:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .auth-main {
        align-items: flex-start;
        padding: 1.25rem 0.875rem;
    }

    .auth-header {
        padding: 1.5rem 1.25rem 0;
    }

    .auth-body {
        padding: 1.5rem 1.25rem;
    }

    .auth-footer {
        padding: 0 1.25rem 1.5rem;
    }

    .auth-card-spacious .auth-body {
        padding: 1.5rem 1.25rem;
    }

    .auth-register-form {
        grid-template-columns: 1fr;
    }

    .auth-register-form .auth-field-full {
        grid-column: auto;
    }

    .auth-register-form .auth-submit-wrapper {
        grid-column: auto;
    }

    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-split-panel {
        display: none;
    }

    .auth-split-content {
        min-height: 100vh;
        padding: 1.25rem 0.875rem;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 0.75rem;
    }

    .auth-container {
        max-width: none;
    }

    .auth-card {
        border-radius: 0.75rem;
    }

    .auth-header {
        padding: 1.25rem 1rem 0;
    }

    .auth-body {
        padding: 1.25rem 1rem;
    }

    .auth-footer {
        padding: 0 1rem 1.25rem;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    .auth-subtitle {
        font-size: 0.875rem;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.625rem;
    }

    .otp-container {
        gap: 0.375rem;
    }

    .otp-input {
        width: 2.75rem;
        height: 3rem;
        flex-basis: 2.75rem;
    }

    .auth-card-spacious .auth-body {
        padding: 1.25rem 1rem;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .auth-input,
    .auth-submit,
    .auth-secondary-action,
    .auth-password-toggle,
    .auth-2fa-method,
    .password-strength-segment {
        transition: none;
    }

    .auth-submit-spinner,
    .auth-loading-indicator {
        animation: none;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .auth-page {
        min-height: auto;
        background: #ffffff;
    }

    .auth-card {
        border: 1px solid #000000;
        box-shadow: none;
    }

    .auth-submit,
    .auth-secondary-action,
    .auth-password-toggle {
        display: none;
    }
}