:root {
    --primary-color: #0299e3;
    --secondary-color: #85d435;
    --accent-color: #ff8d00;
    --background-color: #f0f2f5;
    --text-color: #2c3e50;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #0299e3, #0077b6);
    --gradient-secondary: linear-gradient(135deg, #85d435, #68a628);
    --gradient-accent: linear-gradient(135deg, #ff8d00, #ff6b00);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

html {
    height: -webkit-fill-available;
}

/* Container principal */
.container {
    flex: 1;
    width: 100%;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
}

/* Logo et titre */
.app-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

h1 {
    color: var(--text-color);
    font-size: 1.8em;
    margin-bottom: 12px;
    font-weight: 700;
    text-align: center;
}

.app-subtitle {
    color: var(--text-color);
    opacity: 0.7;
    text-align: center;
    font-size: 0.9em;
    margin-bottom: 24px;
    padding: 0 10px;
    line-height: 1.4;
}

/* Boutons de choix */
.login-choice {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
    width: 100%;
}

.btn {
    width: 100%;
    min-height: 56px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1.1em;
    cursor: pointer;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn i {
    font-size: 1.3em;
}

/* Formulaires de connexion */
.login-form {
    margin-top: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.login-form:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.login-form.hidden {
    display: none;
}

.login-form h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Champ de mot de passe */
input[type="password"] {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(2, 153, 227, 0.2);
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 1.1em;
    background: white;
    -webkit-appearance: none;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 153, 227, 0.1);
}

/* Grille des boutons enfants */
.enfant-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.btn.enfant {
    background: var(--gradient-secondary);
    width: 100%;
    min-height: 56px;
    font-size: 1.1em;
}

/* Bouton d'installation */
.install-btn {
    background: var(--gradient-accent) !important;
    position: fixed;
    bottom: calc(20px + var(--safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: auto;
    min-width: 200px;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(255, 141, 0, 0.3);
}

/* Styles pour les plus grands écrans */
@media (min-width: 768px) {
    .login-choice {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .btn {
        width: 200px;
    }

    .enfant-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 500px;
        margin: 0 auto;
    }

    .btn.enfant {
        width: 100%;
    }
}

/* Support du mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #ffffff;
    }

    .login-container {
        background: rgba(37, 37, 37, 0.95);
    }

    input[type="password"] {
        background: rgba(255, 255, 255, 0.05);
        color: white;
        border-color: rgba(255, 255, 255, 0.1);
    }

    input[type="password"]::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }
}

.version {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.6;
    text-align: center;
    padding: 5px 10px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

@media (prefers-color-scheme: dark) {
    .version {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Bouton de notification */
.notification-btn {
    background: var(--gradient-accent) !important;
    margin-top: 20px;
    width: auto !important;
    min-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

/* Message de notification */
.notification-message {
    position: fixed;
    bottom: calc(20px + var(--safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9em;
    z-index: 1000;
    text-align: center;
    max-width: 90%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .notification-message {
        background: rgba(255, 255, 255, 0.9);
        color: var(--text-color);
    }
} 