/* ==========================================================================
   Concius Engineering MIS — Enterprise Login
   ========================================================================== */

:root {
    --auth-primary: #2563EB;
    --auth-primary-hover: #1D4ED8;
    --auth-primary-ring: rgba(37, 99, 235, 0.14);
    --auth-success: #22C55E;
    --auth-success-bg: #F0FDF4;
    --auth-warning: #F59E0B;
    --auth-warning-bg: #FFFBEB;
    --auth-danger: #EF4444;
    --auth-danger-bg: #FEF2F2;
    --auth-bg: #F8FAFC;
    --auth-text: #0F172A;
    --auth-text-secondary: #64748B;
    --auth-border: #E2E8F0;
    --auth-card-radius: 20px;
    --auth-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --auth-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--auth-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--auth-text);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page Layout
   ========================================================================== */

.auth-page {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 300ms ease;
}

.auth-page.is-loaded {
    opacity: 1;
}

/* Left Branding Panel (40%)
   ========================================================================== */

.auth-branding {
    position: relative;
    flex: 0 0 40%;
    max-width: 40%;
    display: flex;
    flex-direction: column;
    background-color: #0F172A;
    background-image: url("../images/login-hero.jpg");
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.auth-branding-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.78) 45%, rgba(30, 58, 138, 0.65) 100%);
    pointer-events: none;
}

.auth-branding-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.35;
}

.auth-branding-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 48px 56px;
    color: #F8FAFC;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.auth-brand-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

.auth-brand-logo--banner {
    max-width: min(100%, 340px);
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
}

.auth-brand-logo--stacked {
    max-height: 88px;
    width: auto;
    margin: 0 auto;
}

.auth-brand-mark--compact {
    justify-content: center;
    width: 100%;
}

.auth-brand-icon {
    flex-shrink: 0;
    color: #FFFFFF;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-brand-tag {
    font-size: 12px;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.72);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-branding-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
    max-width: 480px;
}

.auth-branding-headline {
    margin: 0 0 20px;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-branding-subtext {
    margin: 0 0 36px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(248, 250, 252, 0.78);
    max-width: 420px;
}

.auth-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.92);
}

.auth-feature-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #60A5FA;
}

.auth-branding-footer {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.55);
    letter-spacing: 0.01em;
}

/* Right Login Panel (60%)
   ========================================================================== */

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--auth-bg);
}

.auth-main-inner {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.auth-mobile-brand {
    display: none;
    width: 100%;
}

.auth-brand-name--dark {
    color: var(--auth-text);
}

.auth-brand-tag--dark {
    color: var(--auth-text-secondary);
    text-transform: none;
    font-size: 13px;
    font-weight: 400;
}

/* Login Card
   ========================================================================== */

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: #FFFFFF;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-card-radius);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.06);
    opacity: 0;
    transform: translateY(12px);
    animation: authCardIn 400ms cubic-bezier(0.4, 0, 0.2, 1) 100ms forwards;
}

@keyframes authCardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-card-title {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--auth-text);
}

.auth-card-subtitle {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: var(--auth-text-secondary);
}

/* Alerts
   ========================================================================== */

.auth-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    animation: authFadeIn 250ms ease;
}

.auth-alert strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.auth-alert p,
.auth-alert ul {
    margin: 0;
}

.auth-alert ul {
    padding-left: 18px;
}

.auth-alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert--error {
    background: var(--auth-danger-bg);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert--error .auth-alert-icon {
    color: var(--auth-danger);
}

.auth-alert--success {
    background: var(--auth-success-bg);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-alert--success .auth-alert-icon {
    color: var(--auth-success);
}

.auth-alert--warning {
    background: var(--auth-warning-bg);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.auth-alert--warning .auth-alert-icon {
    color: var(--auth-warning);
}

.auth-alert--animate {
    animation: authSuccessPulse 600ms ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authSuccessPulse {
    0% { transform: scale(0.98); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* Floating Label Fields
   ========================================================================== */

.auth-field {
    margin-bottom: 20px;
}

.auth-field-inner {
    position: relative;
}

.auth-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94A3B8;
    pointer-events: none;
    transition: color var(--auth-transition);
    z-index: 2;
}

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

.auth-input {
    width: 100%;
    height: 56px;
    padding: 22px 44px 8px 44px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    color: var(--auth-text);
    transition:
        border-color var(--auth-transition),
        box-shadow var(--auth-transition),
        background-color var(--auth-transition);
    outline: none;
    appearance: none;
}

.auth-input::placeholder {
    color: transparent;
}

.auth-label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 500;
    color: var(--auth-text-secondary);
    pointer-events: none;
    transition:
        top var(--auth-transition),
        transform var(--auth-transition),
        font-size var(--auth-transition),
        color var(--auth-transition);
    transform-origin: left center;
    z-index: 1;
}

.auth-input:focus,
.auth-input:not(:placeholder-shown) {
    padding-top: 24px;
    padding-bottom: 6px;
}

.auth-input:focus + .auth-label,
.auth-input:not(:placeholder-shown) + .auth-label {
    top: 12px;
    transform: translateY(0);
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-primary);
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-ring);
}

.auth-input:focus ~ .auth-field-icon {
    color: var(--auth-primary);
}

.auth-field--success .auth-input {
    border-color: var(--auth-success);
}

.auth-field--success .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.auth-field--warning .auth-input {
    border-color: var(--auth-warning);
}

.auth-field--warning .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.auth-field--error .auth-input,
.auth-input.is-invalid {
    border-color: var(--auth-danger);
    background: #FEFEFE;
}

.auth-field--error .auth-input:focus,
.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.auth-field-message {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
}

.auth-field-message--error {
    color: var(--auth-danger);
}

/* Password Toggle
   ========================================================================== */

.auth-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    transition:
        color var(--auth-transition),
        background-color var(--auth-transition);
    z-index: 2;
}

.auth-toggle-password:hover {
    color: var(--auth-text-secondary);
    background: #F1F5F9;
}

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

.auth-toggle-password svg {
    width: 20px;
    height: 20px;
}

.auth-toggle-password .icon-eye-off {
    display: none;
}

.auth-toggle-password.is-visible .icon-eye {
    display: none;
}

.auth-toggle-password.is-visible .icon-eye-off {
    display: block;
}

/* Remember Me & Forgot Password
   ========================================================================== */

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.auth-checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid #CBD5E1;
    border-radius: 5px;
    background: #FFFFFF;
    transition:
        border-color var(--auth-transition),
        background-color var(--auth-transition);
    flex-shrink: 0;
}

.auth-checkbox-box svg {
    width: 12px;
    height: 12px;
    color: #FFFFFF;
    opacity: 0;
    transform: scale(0.6);
    transition:
        opacity var(--auth-transition),
        transform var(--auth-transition);
}

.auth-checkbox-input:checked + .auth-checkbox-box {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-checkbox-input:checked + .auth-checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.auth-checkbox-input:focus-visible + .auth-checkbox-box {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-checkbox-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text-secondary);
}

.auth-forgot-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--auth-transition);
}

.auth-forgot-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-forgot-link:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.auth-back-link-wrap {
    margin-top: 20px;
    text-align: center;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Submit Button
   ========================================================================== */

.auth-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition:
        background-color var(--auth-transition),
        transform 200ms ease,
        box-shadow var(--auth-transition),
        opacity var(--auth-transition);
}

.auth-submit:hover:not(:disabled) {
    background: var(--auth-primary-hover);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

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

.auth-submit:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 3px;
}

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

.auth-submit-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: authSpin 0.65s linear infinite;
    margin-right: 8px;
}

.auth-submit-loading-text {
    display: none;
}

.auth-submit.is-loading .auth-submit-spinner {
    display: inline-block;
}

.auth-submit.is-loading .auth-submit-text {
    display: none;
}

.auth-submit.is-loading .auth-submit-loading-text {
    display: inline;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* Receive Password Via (method selector)
   ========================================================================== */

.auth-method-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #F8FAFC;
}

.auth-method-account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid var(--auth-border);
    color: var(--auth-text-secondary);
}

.auth-method-account-icon svg {
    width: 18px;
    height: 18px;
}

.auth-method-account-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
}

.auth-method-account-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-text-secondary);
}

.auth-method-account-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-method-account .auth-forgot-link {
    flex-shrink: 0;
    font-size: 13px;
}

.auth-method-heading {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.auth-method-option {
    display: block;
    cursor: pointer;
}

.auth-method-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.auth-method-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 14px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: #FFFFFF;
    transition:
        border-color var(--auth-transition),
        box-shadow var(--auth-transition),
        background-color var(--auth-transition);
}

.auth-method-option:hover .auth-method-card {
    border-color: #CBD5E1;
}

.auth-method-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-method-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F1F5F9;
    color: var(--auth-text-secondary);
    transition:
        background-color var(--auth-transition),
        color var(--auth-transition);
}

.auth-method-icon svg {
    width: 24px;
    height: 24px;
}

.auth-method-option[data-channel="whatsapp"] .auth-method-icon {
    background: #E7F8EF;
    color: #1FA855;
}

.auth-method-dot {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #CBD5E1;
    border-radius: 50%;
    background: #FFFFFF;
    transition:
        border-color var(--auth-transition),
        background-color var(--auth-transition);
}

.auth-method-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FFFFFF;
    opacity: 0;
    transform: scale(0.5);
    transition:
        opacity var(--auth-transition),
        transform var(--auth-transition);
}

.auth-method-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-method-detail {
    font-size: 12px;
    color: var(--auth-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-method-radio:checked + .auth-method-card {
    border-color: var(--auth-primary);
    background: #F5F8FF;
    box-shadow: 0 0 0 3px var(--auth-primary-ring);
}

.auth-method-radio:checked + .auth-method-card .auth-method-dot {
    border-color: var(--auth-primary);
    background: var(--auth-primary);
}

.auth-method-radio:checked + .auth-method-card .auth-method-dot::after {
    opacity: 1;
    transform: scale(1);
}

.auth-method-radio:focus-visible + .auth-method-card {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-method-grid--error .auth-method-card {
    border-color: var(--auth-danger);
}

/* SSO Section
   ========================================================================== */

.auth-sso {
    margin-top: 28px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--auth-text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.auth-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--auth-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.65;
    transition:
        border-color var(--auth-transition),
        background-color var(--auth-transition);
}

.auth-sso-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-sso-note {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--auth-text-secondary);
}

/* Trust Section
   ========================================================================== */

.auth-trust {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #F1F5F9;
}

.auth-trust-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-secondary);
}

.auth-trust-header svg {
    width: 16px;
    height: 16px;
    color: var(--auth-success);
}

.auth-trust-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.auth-trust-list li {
    position: relative;
    padding-left: 14px;
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.4;
}

.auth-trust-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #CBD5E1;
}

/* Footer
   ========================================================================== */

.auth-page-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--auth-text-secondary);
}

.auth-page-footer-copy,
.auth-page-footer-version {
    margin: 0;
}

.auth-page-footer-sep {
    color: #CBD5E1;
}

.auth-page-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 14px;
    width: 100%;
    margin-top: 2px;
}

.auth-page-footer-links a {
    color: var(--auth-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--auth-transition);
}

.auth-page-footer-links a:hover {
    color: var(--auth-primary);
}

.auth-page-footer-links a:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.auth-footer-link {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--auth-text-secondary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--auth-transition);
}

.auth-footer-link:hover {
    color: var(--auth-primary);
}

.auth-footer-link:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Support Modal
   ========================================================================== */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.auth-modal-panel {
    position: relative;
    width: min(100%, 420px);
    padding: 32px 28px 28px;
    border-radius: var(--auth-card-radius);
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    text-align: center;
    animation: authModalIn 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-text-secondary);
    cursor: pointer;
    transition: background var(--auth-transition), color var(--auth-transition);
}

.auth-modal-close svg {
    width: 18px;
    height: 18px;
}

.auth-modal-close:hover {
    background: var(--auth-bg);
    color: var(--auth-text);
}

.auth-modal-close:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: var(--auth-primary);
}

.auth-modal-icon svg {
    width: 24px;
    height: 24px;
}

.auth-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-modal-text {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-text-secondary);
}

.auth-modal-email-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-secondary);
}

.auth-modal-email {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    word-break: break-all;
    transition: color var(--auth-transition);
}

.auth-modal-email:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-modal-email:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .auth-branding-content {
        padding: 40px 36px;
    }
}

@media (max-width: 900px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-branding {
        flex: none;
        max-width: none;
        min-height: 280px;
    }

    .auth-branding-body {
        padding: 24px 0;
    }

    .auth-branding-headline {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .auth-branding-subtext {
        font-size: 14px;
        margin-bottom: 0;
    }

    .auth-feature-list,
    .auth-branding-footer {
        display: none;
    }

    .auth-main {
        padding: 32px 20px 40px;
        align-items: flex-start;
    }

    .auth-mobile-brand {
        display: block;
    }

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

    .auth-card-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .auth-branding {
        min-height: 200px;
    }

    .auth-branding-content {
        padding: 24px 20px;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-card-title {
        font-size: 26px;
    }

    .auth-input {
        height: 52px;
        font-size: 16px;
    }
}

/* Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .auth-page {
        opacity: 1;
    }

    .auth-card {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-contrast: more) {
    .auth-input,
    .auth-card,
    .auth-sso-btn {
        border-width: 2px;
    }

    .auth-submit {
        border: 2px solid #1E3A8A;
    }
}
