/* ── ERP login — spacing scale (8px base) ── */

.auth-login-page {
    --auth-space-1: 0.25rem;   /* 4px */
    --auth-space-2: 0.5rem;    /* 8px */
    --auth-space-3: 0.75rem;   /* 12px */
    --auth-space-4: 1rem;      /* 16px */
    --auth-space-5: 1.25rem;   /* 20px */
    --auth-space-6: 1.5rem;    /* 24px */
    --auth-space-7: 1.75rem;   /* 28px */
    --auth-space-8: 2rem;      /* 32px */
    --auth-space-9: 2.5rem;    /* 40px */
    --auth-space-10: 3rem;     /* 48px */
    --auth-card-pad-x: clamp(1.25rem, 4vw, 1.5rem);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-login-page.auth-setup-backdrop-body {
    background: transparent;
}

.auth-login-page .container {
    width: 100%;
    max-width: 440px;
    padding: var(--auth-space-4) var(--auth-space-3);
}

/* ── Card ── */

.auth-login-page .auth-login-card.card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.03),
        0 20px 40px rgba(15, 23, 42, 0.12),
        0 6px 14px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: auth-login-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-login-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Main + header ── */

.auth-login-card__main {
    padding: var(--auth-space-6) var(--auth-card-pad-x) var(--auth-space-5);
}

.auth-login-card__head {
    margin-bottom: var(--auth-space-6);
    text-align: center;
}

.auth-login-card__logo {
    display: block;
    max-width: 168px;
    width: 100%;
    height: auto;
    margin: 0 auto var(--auth-space-5);
}

.auth-login-card__head h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.4;
}

.auth-login-card__head p {
    margin: var(--auth-space-2) 0 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
}

/* ── Alert ── */

.auth-login-alert {
    display: flex;
    gap: var(--auth-space-3);
    align-items: flex-start;
    padding: var(--auth-space-3) var(--auth-space-4);
    margin: 0 0 var(--auth-space-4);
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-login-alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-login-alert svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ── Form ── */

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-login-field {
    margin-bottom: var(--auth-space-4);
}

.auth-login-field:last-of-type {
    margin-bottom: 0;
}

.auth-login-field label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.auth-login-field label .req {
    color: #dc2626;
    margin-left: var(--auth-space-1);
}

.auth-login-input-wrap {
    position: relative;
}

.auth-login-input-icon {
    position: absolute;
    left: var(--auth-space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 1.0625rem;
    height: 1.0625rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-login-input-wrap:focus-within .auth-login-input-icon {
    color: #3d8b89;
}

.auth-login-page .auth-login-form .form-control {
    width: 100%;
    margin: 0;
    padding: 0.6875rem 0.75rem 0.6875rem 2.375rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-login-input-wrap--password .form-control {
    padding-right: 2.75rem;
}

.auth-login-page .auth-login-form .form-control::placeholder {
    color: #94a3b8;
}

.auth-login-page .auth-login-form .form-control:hover:not(:focus):not(.error) {
    border-color: #cbd5e1;
    background: #fff;
}

.auth-login-page .auth-login-form .form-control:focus {
    outline: none;
    border-color: #3d8b89;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(61, 139, 137, 0.14);
}

.auth-login-page .auth-login-form .form-control.error {
    border-color: #ef4444;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-login-field .error-message {
    margin-top: var(--auth-space-2);
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #dc2626;
}

.auth-login-toggle-pw {
    position: absolute;
    right: var(--auth-space-2);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-login-toggle-pw svg {
    display: none;
    flex-shrink: 0;
}

.auth-login-toggle-pw[data-pw-visible="false"] .auth-login-icon-eye,
.auth-login-toggle-pw[data-pw-visible="true"] .auth-login-icon-eye-off {
    display: block;
}

.auth-login-toggle-pw:hover {
    color: #475569;
    background: #f1f5f9;
}

/* ── Submit ── */

.auth-login-submit {
    width: 100%;
    margin-top: var(--auth-space-5);
    padding: 0.75rem var(--auth-space-4);
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-login-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.34);
    transform: translateY(-1px);
}

.auth-login-submit:active {
    transform: translateY(0);
}

.auth-login-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.32), 0 2px 8px rgba(30, 64, 175, 0.28);
}

/* ── Footer ── */

.auth-login-card__footer {
    padding:
        var(--auth-space-4)
        var(--auth-card-pad-x)
        var(--auth-space-4);
    border-top: 1px solid #eef2f6;
    background: rgba(248, 250, 252, 0.75);
    text-align: center;
}

.auth-login-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--auth-space-2) var(--auth-space-4);
    margin: 0 0 var(--auth-space-3);
    padding: 0;
    list-style: none;
}

.auth-login-badges li {
    display: inline-flex;
    align-items: center;
    gap: var(--auth-space-2);
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.auth-login-badges svg {
    color: #3d8b89;
    opacity: 0.85;
    flex-shrink: 0;
}

.auth-login-card__copy {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #94a3b8;
}

@media (max-width: 480px) {
    .auth-login-card__main {
        padding: var(--auth-space-4) var(--auth-card-pad-x);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-login-page .auth-login-card.card {
        animation: none;
    }
}
