﻿:root {
    --color-light-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --color-dark-bg: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --color-white: #ffffff;
    --color-black: #333;
    --color-dark-gray: #2c3e50;
    --color-medium-gray: #666;
    --color-light-gray: #e9ecef;
    --color-accent: #1abc9c;
    --color-accent-dark: #16a085;
    --color-shadow-light: rgba(0, 0, 0, 0.1);
    --color-shadow-accent: rgba(26, 188, 156, 0.3);
    --color-border-focus: rgba(26, 188, 156, 0.25);
    --color-dark-container: #34495e;
    --color-dark-border: #3498db;
    --color-light-text: #ecf0f1;
    --color-medium-text: #bdc3c7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--color-light-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    transition: all 0.3s ease;
    background-image: url('../img/arriere-plan-appli.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    padding: 20px;
}

    body > form {
        width: 100%;
        max-width: 450px;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }

.container {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--color-shadow-light);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--color-dark-gray);
        display: block;
    }

.form-control {
    border: 2px solid var(--color-light-gray);
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 16px;
}

    .form-control:focus {
        border-color: var(--color-accent);
        box-shadow: 0 0 0 0.2rem var(--color-border-focus);
        outline: none;
    }

.btn-submit {
    background: var(--color-accent);
    color: var(--color-white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-size: 16px;
    cursor: pointer;
}

    .btn-submit:hover {
        background: var(--color-accent-dark);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px var(--color-shadow-accent);
    }

.form-check {
    margin: 1rem 0;
    display: flex;
    align-items: center;
}

.form-check-label {
    color: var(--color-medium-gray);
    margin-left: 0.5rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

    a:hover {
        color: var(--color-accent-dark);
        text-decoration: none;
    }

/* Dark Mode */
.dark-mode {
    background: var(--color-dark-bg);
    color: var(--color-light-text);
    background-image: url('../img/arriere-plan-appli.jpg');
    background-size: cover;
    background-attachment: fixed;
}

    .dark-mode .container {
        background: rgba(52, 73, 94, 0.95);
        backdrop-filter: blur(10px);
    }

    .dark-mode .form-control {
        background-color: var(--color-dark-gray);
        border-color: var(--color-dark-border);
        color: var(--color-light-text);
    }

    .dark-mode label {
        color: var(--color-light-text);
    }

    .dark-mode .form-check-label {
        color: var(--color-medium-text);
    }

/* Theme Toggle Button */
.btn-toggle-theme {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px var(--color-shadow-light);
    transition: all 0.3s ease;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
}

    .btn-toggle-theme:hover {
        background: var(--color-accent-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px var(--color-shadow-accent);
    }

/* Language Selector */
.language-selector {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lang-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    border: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

    .lang-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .lang-btn.active {
        box-shadow: 0 0 0 3px var(--color-accent);
        transform: scale(1.1);
    }

    .lang-btn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

.icon-small {
    width: 30px;
    height: 30px;
}

/* CAPTCHA Styles */
.captcha-container {
    margin: 0.5rem 0;
    display: flex;

}

#captchaCanvas {
    border: 2px solid var(--color-light-gray);
    border-radius: 8px;
    background: white;
}

/* Arabic Support */
.form-group-arab {
    direction: rtl;
    text-align: right;
}

    .form-group-arab label {
        text-align: right;
    }

.container-arab {
    direction: rtl;
}

.form-check-arab {
    direction: rtl;
    justify-content: flex-end;
}

.form-check-label-arab {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
        background-attachment: scroll;
    }

    .container {
        padding: 2rem;
        margin: 0;
        border-radius: 12px;
    }

    .language-selector {
        top: -25px;
        padding: 0.4rem;
        gap: 0.5rem;
    }

    .lang-btn {
        width: 36px;
        height: 36px;
    }

    .icon-small {
        width: 26px;
        height: 26px;
    }

    .btn-toggle-theme {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        background-attachment: scroll;
    }

    .container {
        padding: 1.5rem;
        border-radius: 10px;
        margin-top: 40px;
    }

    .language-selector {
        position: static;
        transform: none;
        margin-bottom: 1.5rem;
        justify-content: center;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 40px;
        padding: 0.5rem;
    }

    .lang-btn {
        width: 35px;
        height: 35px;
    }

    .icon-small {
        width: 25px;
        height: 25px;
    }

    .form-control {
        font-size: 16px;
        padding: 0.8rem;
    }

    .btn-submit {
        padding: 0.8rem 1.5rem;
        font-size: 16px;
    }

    .btn-toggle-theme {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    #captchaCanvas {
        width: 120px;
        height: 32px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 1rem;
        margin-top: 30px;
    }

    .language-selector {
        margin-bottom: 1rem;
        padding: 0.3rem;
        gap: 0.3rem;
    }

    .lang-btn {
        width: 32px;
        height: 32px;
    }

    .icon-small {
        width: 22px;
        height: 22px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .container {
        padding: 1rem;
        margin-top: 20px;
    }

    .language-selector {
        margin-bottom: 0.5rem;
    }

    .form-group {
        margin-bottom: 0.8rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .btn-toggle-theme {
        bottom: 5px;
        right: 5px;
        padding: 6px 10px;
        font-size: 11px;
    }
}
