/* ========================================
   LOGIN SCREEN — EURO APAVOL SA
   Design: Teal/Slate · DM Sans · Clean
   ======================================== */

/* ── Overlay ──────────────────────────── */

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 40%, #0f766e 100%);
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.login-overlay.login-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Subtle pattern */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(13, 148, 136, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

/* ── Card ─────────────────────────────── */

.login-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 400px;
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    opacity: 0;
    transform: translateY(20px);
    animation: loginSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes loginSlideUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Logo ─────────────────────────────── */

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.login-title {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin: 0 0 28px 0;
}

/* ── Form ─────────────────────────────── */

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    position: relative;
    width: 100%;
}

.login-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.login-field-icon svg {
    width: 18px;
    height: 18px;
}

.login-input {
    width: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 13px 14px 13px 42px;
    outline: none;
    transition: all 0.2s ease;
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.login-input:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.login-input:focus {
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.login-input:focus + .login-field-icon,
.login-field:focus-within .login-field-icon {
    color: #0d9488;
}

/* Toggle password visibility */
.login-toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.login-toggle-pwd:hover {
    color: #475569;
}

.login-toggle-pwd svg {
    width: 18px;
    height: 18px;
}

/* ── Submit ────────────────────────────── */

.login-submit {
    width: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border: none;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.25);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 18px rgba(13, 148, 136, 0.35);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0) scale(0.98);
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* Spinner */
.login-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: loginSpin 0.6s linear infinite;
    display: none;
}

.login-submit.loading .login-spinner {
    display: block;
}

.login-submit.loading .login-submit-text {
    display: none;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* ── Error ────────────────────────────── */

.login-error {
    width: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    display: none;
    animation: loginShake 0.4s ease;
}

.login-error.visible {
    display: block;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ── Footer ───────────────────────────── */

.login-footer {
    margin-top: 24px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    color: #cbd5e1;
    letter-spacing: 0.02em;
}

/* ── Responsive ───────────────────────── */

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .login-logo {
        width: 56px;
        height: 56px;
    }

    .login-title {
        font-size: 20px;
    }
}

/* ── Hide app behind login ────────────── */

body.auth-locked .app-wrapper {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}