/* =====================================================================
   Serveur MegaPost — Pages d'authentification compactes sur mobile
   (login, mot de passe oublié, réinitialisation). Desktop intact.
   ===================================================================== */

/* ---------- Base styles (all viewports) ---------- */

.auth-logo-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    overflow: hidden;
    letter-spacing: -.5px;
}

.auth-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand h1 {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.2;
}

.auth-brand p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

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

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 5px;
}

.auth-field input,
.auth-password-field input {
    width: 100%;
    height: 46px;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    padding: 8px 12px;
    background: #ffffff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    display: block;
}

.auth-field input:focus,
.auth-password-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

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

.auth-password-field input {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.auth-password-toggle i {
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.auth-password-toggle:hover { color: #2563eb; }

.auth-submit {
    height: 46px;
    min-height: 46px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 4px;
}

.auth-links a {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

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

.auth-help-note {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
    text-align: center;
}

.auth-footer-note {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* ---------- Mobile overrides (≤768px) ---------- */

@media (max-width: 768px) {

    html, body { overflow-x: hidden !important; }

    .auth-body {
        min-height: 100dvh !important;
        padding: 18px 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, .14), transparent 35%),
            linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%) !important;
        overflow-x: hidden !important;
    }

    .auth-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 390px !important;
        margin: 0 auto !important;
    }

    .auth-card,
    .auth-small-card {
        width: 100% !important;
        max-width: 390px !important;
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 22px !important;
        padding: 20px !important;
        box-shadow: 0 18px 45px rgba(15, 23, 42, .10) !important;
    }

    .auth-brand {
        margin-bottom: 16px !important;
    }

    .auth-logo-wrap {
        width: 56px !important;
        height: 56px !important;
        font-size: 19px !important;
    }

    .auth-brand h1 {
        font-size: 22px !important;
        line-height: 1.15 !important;
        margin: 0 !important;
        font-weight: 900 !important;
        color: #0f172a !important;
    }

    .auth-brand p {
        font-size: 12px !important;
        color: #64748b !important;
        margin: 5px 0 0 !important;
        line-height: 1.35 !important;
    }

    .auth-form {
        gap: 10px !important;
    }

    .auth-field label {
        font-size: 12px !important;
        font-weight: 800 !important;
        color: #334155 !important;
        margin-bottom: 4px !important;
    }

    .auth-field input,
    .auth-password-field input {
        height: 42px !important;
        min-height: 42px !important;
        font-size: 13px !important;
        border-radius: 12px !important;
        padding: 8px 11px !important;
    }

    .auth-password-field input {
        padding-right: 42px !important;
    }

    .auth-password-toggle {
        right: 7px !important;
        width: 30px !important;
        height: 30px !important;
    }

    .auth-password-toggle i {
        font-size: 16px !important;
    }

    .auth-submit {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
        font-weight: 900 !important;
        padding: 8px 12px !important;
        margin-top: 2px !important;
    }

    .auth-links {
        margin-top: 2px !important;
    }

    .auth-links a {
        font-size: 12px !important;
        font-weight: 800 !important;
        color: #2563eb !important;
    }

    .auth-help-note {
        margin-top: 12px !important;
        padding: 9px 10px !important;
        font-size: 11px !important;
        border-radius: 12px !important;
        line-height: 1.35 !important;
    }

    .auth-footer-note {
        margin-top: 12px !important;
        padding-top: 10px !important;
        font-size: 11px !important;
    }

    .auth-alert,
    .alert {
        border-radius: 12px !important;
        padding: 9px 10px !important;
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }

    #pwa-login-install {
        padding-top: 12px !important;
        border-top: 1px solid #e5e7eb !important;
    }
}

/* ---------- Very small screens (≤370px) ---------- */

@media (max-width: 370px) {

    .auth-card,
    .auth-small-card {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .auth-brand h1 {
        font-size: 20px !important;
    }

    .auth-logo-wrap {
        width: 50px !important;
        height: 50px !important;
    }
}
