/* ============================================================
   BASE — reset, body, typographie, liens, template classique
   ============================================================ */

/* Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: Roboto, sans-serif;
    background: var(--primary-light);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-black);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================================
   TEMPLATE CLASSIQUE (pages non-fullscreen)
   ============================================================ */

.kc-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.frello-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(var(--shadow-drop));
    transition: transform var(--transition-normal);
}

.frello-logo:hover {
    transform: scale(1.05);
}

.form-login {
    background: var(--background-overlay);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-form);
    padding: 36px;
    width: calc(100vw - 80px);
    max-width: 520px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--background-overlay-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
}

.kc-form-header {
    text-align: center;
    margin-bottom: 32px;
}

#kc-page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-black);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

#kc-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#kc-content-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   SÉLECTEUR DE LANGUE (template classique)
   ============================================================ */

details {
    position: absolute;
    top: 24px;
    right: 24px;
}

summary {
    cursor: pointer;
    padding: 8px 16px;
    background: var(--background-overlay-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s ease;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

summary::-webkit-details-marker,
summary::marker {
    display: none;
}

summary:hover {
    background: var(--background-overlay-dark);
    color: var(--text-dark);
}

.language-flag {
    width: 24px;
    height: 18px;
    border-radius: 4px;
}

.locale-ul {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-locale);
    padding: 8px 0;
    margin: 8px 0 0 0;
    min-width: 160px;
    list-style: none;
    z-index: 1000;
    max-height: 300px;
    overflow: auto;
}

.locale-li {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.locale-li:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

.locale-li[data-active="true"] {
    background: var(--primary-light);
    color: var(--primary-color);
}

.locale-ul a,
.locale-ul a:hover {
    all: unset;
}

/* ============================================================
   TEMPLATE CLASSIQUE — RESPONSIVE
   ============================================================ */

@media (max-height: 800px) {
    .kc-login {
        padding: 20px 12px;
    }

    .form-login {
        padding: 20px 24px;
        margin: auto;
        border-radius: 16px;
        max-height: none;
        overflow-y: visible;
    }

    .frello-logo {
        height: 50px;
        margin-bottom: 10px;
    }

    #kc-page-title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    details {
        top: 10px;
        right: 10px;
        font-size: 13px;
    }

    details summary {
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .kc-login {
        padding: 16px;
    }

    .form-login {
        padding: 32px 24px;
        margin: 20px auto;
        border-radius: 20px;
        width: calc(100% - 40px);
        max-width: 480px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .frello-logo {
        height: 60px;
    }

    #kc-page-title {
        font-size: 24px;
    }

    details {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .kc-login {
        padding: 0;
        justify-content: center;
        background: #fff !important;
        min-height: 100vh;
    }

    body {
        background: #fff !important;
    }

    .form-login {
        padding: 24px 20px;
        margin: auto;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        overflow-y: auto;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        box-shadow: none;
        border: none;
        background: #fff;
    }

    .frello-logo {
        height: 50px;
        margin: 16px 0;
    }

    #kc-page-title {
        font-size: 22px;
    }

    details {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 768px) and (max-height: 800px) {
    .frello-logo {
        height: 36px;
        margin-bottom: 6px;
    }

    #kc-page-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
}
