/* ======================================================
   RESET & BASE
====================================================== */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #f5ede0;
    color: #111;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #111 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ======================================================
   BACKGROUND
====================================================== */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("/static/images/authImg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ======================================================
   LANGUAGE SELECTOR
====================================================== */
.lang-selector { position: relative; z-index: 20; }
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 999px;
    padding: 5px 12px 5px 7px;
    cursor: pointer;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s;
}
.lang-btn:hover { background: #f5f5f5; }
.lang-flag {
    width: 24px; height: 17px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.lang-chevron { font-size: 10px; opacity: 0.6; color: #111; }
.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
    overflow: hidden;
    min-width: 150px;
    z-index: 9999;
    border: 1px solid #eee;
}
.lang-dropdown.open { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    transition: background 0.15s;
}
.lang-option:hover { background: #f5f5f5; }
.lang-option.active { background: #fff0f0; color: #ce0201; }
.lang-option img {
    width: 24px; height: 17px;
    border-radius: 3px;
    object-fit: cover;
}

/* ======================================================
   CONTAINER
====================================================== */
.container {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 420px;
    margin: 3vh auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ======================================================
   LOGO
====================================================== */
.logo {
    width: 55%;
    max-width: 180px;
    margin-bottom: 4px;
}

/* ======================================================
   TITLE
====================================================== */
.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 2px 0 12px;
    color: #111 !important;
}

/* ======================================================
   FORM
====================================================== */
form {
    width: 100%;
    background: transparent;
    padding: 0;
    margin-top: 2px;
}

.mb-3 {
    width: 100%;
    margin-bottom: 12px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: #111 !important;
}

/* ======================================================
   INPUT
====================================================== */
.input-icon-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #ce0201;
    font-size: 0.9rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 10px 14px 10px 38px;
    border-radius: 12px;
    border: 1.5px solid #ce0201;
    background: #fafafa;
    color: #111;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.form-control::placeholder { color: #aaa; font-size: 0.9rem; }
.form-control:focus {
    border-color: #ce0201;
    background: white;
    box-shadow: 0 0 0 3px rgba(206,2,1,0.07);
}

/* ======================================================
   PASSWORD TOGGLE
====================================================== */
.password-wrapper { position: relative; }
.toggle-password {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #ce0201;
    font-size: 0.95rem;
    z-index: 2;
}
.toggle-password:hover { color: #a50101; }

/* ======================================================
   SMALL TEXT
====================================================== */
small {
    display: block;
    margin: 6px 0 4px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #111;
    font-weight: 700;
}
small a { color: #ce0201; text-decoration: underline; font-weight: 600; }

.forgot-password {
    display: block;
    margin: 4px 0 12px;
    font-size: 0.85rem;
    color: #ce0201;
    text-decoration: underline;
    font-weight: 700;
    text-align: center;
}
.disabled-link { opacity: 0.4; pointer-events: none; cursor: not-allowed; }

/* ======================================================
   BUTTONS
====================================================== */
.login-btn {
    width: 100%;
    padding: 13px;
    border-radius: 14px;
    border: none;
    background-color: #ce0201;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    margin-bottom: 10px;
    display: block;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(206,2,1,0.22);
}
.login-btn:hover {
    background-color: #a50101;
    transform: translateY(-1px);
}
.login-btn.transparent {
    background: white;
    color: #ce0201;
    border: 2px solid #ce0201;
    box-shadow: none;
}
.login-btn.transparent:hover { background: #fff0f0; }

/* ======================================================
   ERROR
====================================================== */
.error-msg {
    width: 100%;
    background: #fff0f0;
    border: 1.5px solid #ffcccc;
    color: #ce0201;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

/* ======================================================
   TAGLINE
====================================================== */
.tagline {
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #111;
    font-style: italic;
    font-weight: 700;
}

/* ======================================================
   COOKIE BANNER
====================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #111;
    color: white;
    padding: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    z-index: 3000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}
.cookie-banner.visible { transform: translateY(0%); }
.cookie-content {
    max-width: 960px; width: 90%;
    display: flex; flex-wrap: wrap;
    justify-content: space-between;
    align-items: center; gap: 8px;
}
.cookie-content a { color: #fff; text-decoration: underline; }
.cookie-buttons { display: flex; gap: 8px; }
.btn-primary {
    background: #ce0201; border: none;
    padding: 7px 12px; border-radius: 7px;
    color: white; cursor: pointer; font-weight: 700;
}
.btn-secondary {
    background: transparent; border: 1px solid #fff;
    padding: 7px 12px; border-radius: 7px;
    color: white; cursor: pointer;
}

/* ======================================================
   MODALE
====================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    width: 100vw; height: 100dvh;
    padding: 16px; display: none;
    justify-content: center; align-items: center;
    background: rgba(0,0,0,.45); z-index: 999999;
}
.modal-overlay.is-open { display: flex !important; }
.modal-box {
    width: min(480px, 92vw); max-width: 92vw;
    box-sizing: border-box; margin: 0 auto;
    border-radius: 18px; background: #fff;
    padding: 20px 18px; text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,0.18);
    animation: modalIn .22s ease-out;
}
@keyframes modalIn {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.modal-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    background: #fff0f0; color: #ce0201; font-size: 22px;
}
.modal-title { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: #111; }
.modal-text  { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: #111; }
.modal-btn {
    width: 100%; border: none; border-radius: 12px;
    padding: 12px; font-weight: 800; font-size: 14px;
    cursor: pointer; background: #ce0201; color: white;
    transition: background 0.2s;
}
.modal-btn:hover { background: #a50101; }

/* ======================================================
   DESKTOP
====================================================== */
@media (min-width: 1024px) {
    body { align-items: center; }
    .container { max-width: 440px; margin: 0 auto; }
    .logo { max-width: 220px; }
    .form-title { font-size: 1.9rem; }
    .form-control { height: 52px; }
    .login-btn { font-size: 1.05rem; padding: 14px; }
}