@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* 🌞 Variables pour le thème clair par défaut */
:root {
    --primary: #a68dd2;
    --primary-hover: #8f76c7;
    --bg: #f4f0fa;
    --bg-card: #ffffff;
    --text-dark: #2e2a36;
    --text-light: #7e7591;
    --border: #ddd;
    --input-bg: #ffffff;
}

/* 🌙 Dark mode appliqué via html.dark */
html.dark {
    --primary: #bb86fc;
    --primary-hover: #9b6fe7;
    --bg: #1e1b24;
    --bg-card: #2a2733;
    --text-dark: #e0e0e0;
    --text-light: #aaaaaa;
    --border: #444;
    --input-bg: #3a3545;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, color 0.3s;
}

.container {
    background: var(--bg-card);
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
    transition: background 0.3s;
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 600;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-light);
}

.error {
    color: red;
    font-size: 13px;
    margin-top: -16px;
    margin-bottom: 12px;
}


input {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    font-size: 16px;
    transition: border-color 0.2s, background-color 0.3s, color 0.3s;
    color: var(--text-dark);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(166, 141, 210, 0.2);
}

button {
    background-color: var(--primary);
    color: white;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background-color: var(--primary-hover);
}

.text-center {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 20px;
}

.text-center a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.text-center a:hover {
    text-decoration: underline;
}

/* 🌗 Bouton Dark Mode Toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.toggle {
    width: 60px;
    height: 30px;
    background-color: var(--border);
    border-radius: 30px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle .slider {
    width: 26px;
    height: 26px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease, background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input[type="checkbox"] {
    display: none;
}

input:checked + .toggle {
    background-color: var(--primary);
}

input:checked + .toggle .slider {
    transform: translateX(30px);
    background-color: #fff;
}

select.styled-select {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--input-bg);
    font-size: 16px;
    color: var(--text-dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='%237e7591' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.584l3.71-4.355a.75.75 0 111.14.976l-4.25 5a.75.75 0 01-1.14 0l-4.25-5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
}

select.styled-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(166, 141, 210, 0.2);
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    flex: 1;
    padding-right: 40px; /* espace pour l'icône */
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 14px;
    top: 22px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}


.toggle-password:hover {
    color: var(--primary);
}

.toggle-password svg {
    pointer-events: none;
}
