/* Reset, base html/body, touch-action, color-scheme, Oswald :
   fournis par css/app-shell.css, chargé avant ce fichier. */

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse 900px 500px at 50% -10%, rgba(47, 138, 255, 0.07), transparent 60%),
        #f5f6f8;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
             env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

img { max-width: 100%; height: auto; }

/* ── CONTAINER ── */
.login-container {
    width: 1100px;
    max-width: 100%;
    height: auto;
    min-height: 650px;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #e4e7ec;
    border-top: 2px solid #2f8aff;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.12);
    background: #ffffff;
}

/* ── LEFT IMAGE ── */
.login-image {
    width: 50%;
    flex-shrink: 0;
    position: relative;
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Voile "stade en nocturne" sur la photo, cohérent avec l'identité foot */
.login-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2,13,31,0.15) 0%, rgba(2,13,31,0.55) 100%);
    pointer-events: none;
}

/* ── RIGHT FORM ── */
.login-form-container {
    width: 50%;
    padding: clamp(28px, 5vw, 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #0f1b3d;
}

.logo {
    width: clamp(60px, 12vw, 80px);
    margin: 0 auto 16px;
    display: block;
    border: 1.5px solid rgba(47, 138, 255, 0.3);
    border-radius: 8px;
    background: #f3f4f6;
    padding: 4px;
}

.login-form-container h1 {
    text-align: center;
    color: #2f8aff;
    margin-bottom: 8px;
    font-family: 'Oswald', Arial, Helvetica, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: clamp(21px, 4.5vw, 26px);
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: clamp(13px, 3vw, 14px);
}

/* ── INPUTS ── */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.input-group label {
    margin-bottom: 7px;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.input-group input {
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #0f1b3d;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-height: 48px;
    /* 16px empêche le zoom automatique sur iOS */
    font-size: 16px;
}

.input-group input:focus {
    border-color: rgba(47, 138, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(47, 138, 255, 0.08);
}

.input-group input::placeholder {
    color: #9ca3af;
    font-size: 14px;
}

/* ── REMEMBER / FORGOT ── */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    min-height: 44px;
}

.remember input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2f8aff;
}

.forgot-link {
    color: #2f8aff;
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.forgot-link:hover { opacity: 0.75; }

/* ── BUTTON ── */
.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    background: #2f8aff;
    color: #ffffff;
    font-family: 'Oswald', Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.06em;
    min-height: 48px;
}

.login-btn:hover {
    opacity: 0.92;
    box-shadow: 0 8px 24px rgba(47, 138, 255, 0.2);
}
.login-btn:active { transform: scale(0.98); }

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── DIVIDER ── */
.divider {
    display: flex;
    align-items: center;
    margin: 22px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e4e7ec;
}

.divider span {
    margin: 0 14px;
    color: #9ca3af;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── SIGNUP ── */
.signup-text {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.signup-text a {
    color: #2f8aff;
    text-decoration: none;
    font-weight: bold;
}

.signup-text a:hover { text-decoration: underline; }

/* ── MESSAGE ── */
.message {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    min-height: 18px;
}

.message.error   { color: #dc2626; }
.message.success { color: #15803d; }


/* ══════════════════════════════════════
   TABLETTE (640px – 1024px)
   L'image disparaît, le formulaire
   prend toute la largeur.
══════════════════════════════════════ */
@media (max-width: 1024px) {
    body {
        align-items: flex-start;
        padding-top: max(20px, env(safe-area-inset-top, 0px));
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
        padding-left: clamp(16px, 4vw, 24px);
        padding-right: clamp(16px, 4vw, 24px);
    }

    .login-container {
        width: 100%;
        min-height: auto;
        border-radius: 10px;
        flex-direction: column;
    }

    .login-image {
        display: none;
    }

    .login-form-container {
        width: 100%;
        padding: clamp(32px, 5vw, 44px) clamp(24px, 5vw, 40px);
    }
}


/* ══════════════════════════════════════
   TÉLÉPHONE (< 640px)
   Plein écran, comme une vraie appli
   native — pas de carte flottante.
══════════════════════════════════════ */
@media (max-width: 639px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .login-container {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        border: none;
        border-top: none;
        box-shadow: none;
    }

    .login-form-container {
        padding: max(40px, env(safe-area-inset-top, 0px) + 24px)
                 20px
                 max(32px, env(safe-area-inset-bottom, 0px) + 20px);
        justify-content: center;
    }

    .logo {
        width: 64px;
    }

    .login-form-container h1 {
        font-size: 22px;
    }

    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

