/* Fichier: css/style.css */
/* Description: Styles pour l'interface publique */

:root {
    --primary-color: #f38500;
    --primary-color-dark: #d17000;
    --primary-color-rgb: 243, 133, 0;
    --secondary-color: #333;
    --error-color: #cc0000;
    --error-color-rgb: 204, 0, 0;
    --success-color: #28a745;
    --success-color-rgb: 40, 167, 69;

    /* Light Theme */
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

html.dark-mode {
    /* Dark Theme */
    --bg-color: #2c2c2c;
    --bg-secondary: #1a1a1a;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #444444;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* --- Reset Global --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color); /* Use CSS variable */
    background-color: var(--bg-color); /* Use CSS variable */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s, color 0.4s; /* Add transition for smooth theme change */
}

/* --- Top Bar (Language & Theme Switcher) --- */
.lang-theme-bar { /* Renamed from .top-bar for consistency with index.php */
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background-color: var(--bg-secondary); /* Use theme variable */
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
    flex-wrap: wrap; /* Allow items to wrap */
    gap: 10px; /* Space between items */
}

/* --- Améliorations des boutons de langue et thème --- */
/* These styles are likely in language-theme-buttons.css or toggle.css,
   but ensuring they are responsive here for general layout */
.lang-btn {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* --- Header --- */
.site-header {
    text-align: center;
    padding: 20px 0;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    max-height: 80px;
    width: auto;
    transition: max-height 0.3s ease; /* Smooth transition for logo size */
}

/* --- Main Content --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
    display: flex; /* Use flex for centering content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.verification-card {
    background-color: var(--bg-color); /* Use theme variable */
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    max-width: 800px;
    width: 100%; /* Ensure it takes full width on smaller screens */
    margin: 0 auto;
    transition: padding 0.3s ease; /* Smooth transition for padding */
}

.verification-card h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
    transition: font-size 0.3s ease; /* Smooth transition for font size */
}

.subtitle {
    color: var(--text-secondary); /* Use theme variable */
    margin-bottom: 25px;
    transition: font-size 0.3s ease; /* Smooth transition for font size */
}

/* --- Form Styles --- */
.verification-form {
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow input and button to wrap */
}

.form-group input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    min-width: 150px; /* Ensure input is not too small */
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.verify-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.verify-btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-1px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Message Box --- */
.message-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message-box.success {
    background-color: rgba(var(--success-color-rgb), 0.1);
    color: var(--success-color);
    border: 1px solid rgba(var(--success-color-rgb), 0.3);
}

.message-box.error {
    background-color: rgba(var(--error-color-rgb), 0.1);
    color: var(--error-color);
    border: 1px solid rgba(var(--error-color-rgb), 0.3);
}

/* --- Results Card --- */
.results-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.results-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--primary-color); /* Default for success/error will override */
    color: white;
    transition: padding 0.3s ease, font-size 0.3s ease;
}

.results-header .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    flex-grow: 1;
    transition: font-size 0.3s ease;
}

.results-body {
    padding: 20px;
    background-color: var(--bg-color); /* Use theme variable */
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; /* Allow content to wrap */
    gap: 5px; /* Space between label and strong */
}

.result-item:last-child {
    border-bottom: none;
}

.result-item span {
    color: var(--text-secondary); /* Use theme variable */
    flex-shrink: 0;
}

.result-item strong {
    text-align: right; /* Align value to the right */
    flex-grow: 1; /* Allow value to take remaining space */
    word-break: break-word; /* Break long words */
}

.results-card.success .results-header {
    background-color: var(--success-color);
}

.results-card.error .results-header {
    background-color: var(--error-color);
}

/* --- Footer --- */
.site-footer-bottom {
    background-color: var(--bg-secondary); /* Use theme variable */
    color: var(--text-color); /* Use theme variable */
    padding: 30px 20px;
    margin-top: auto;
    transition: padding 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.contact-info, .legal-info {
    flex: 1; /* Allow sections to grow */
    min-width: 250px; /* Minimum width before wrapping */
}

.contact-info p, .legal-info p {
    margin-bottom: 10px;
}

.contact-info span {
    margin-right: 8px;
}

.footer-content a {
    color: var(--text-color); /* Use theme variable */
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* --- Innov Academie Link in Footer --- */
.innov-link-container {
    margin-top: 15px;
    text-align: center; /* Center the link */
    width: 100%; /* Take full width */
}

.innov-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff; /* Explicitly white */
    padding: 8px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.innov-link:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

/* --- Responsive Adjustments --- */

/* Medium devices (tablets, 768px and up) */
@media (max-width: 768px) {
    .lang-theme-bar {
        padding: 10px;
        justify-content: center; /* Center items on smaller screens */
    }

    .site-logo {
        max-height: 60px; /* Smaller logo on tablets */
    }

    .container {
        padding: 15px; /* Reduce container padding */
    }

    .verification-card {
        padding: 20px; /* Reduce card padding */
    }

    .verification-card h1 {
        font-size: 1.6rem; /* Smaller heading */
    }

    .subtitle {
        font-size: 0.95rem; /* Smaller subtitle */
    }

    .form-group {
        flex-direction: column; /* Stack input and button */
    }
    
    .form-group input {
        min-width: unset; /* Remove min-width */
    }

    .verify-btn {
        width: 100%; /* Full width button */
    }

    .results-header {
        padding: 15px; /* Reduce results header padding */
    }

    .results-header h2 {
        font-size: 1.3rem; /* Smaller results heading */
    }

    .results-body {
        padding: 15px; /* Reduce results body padding */
    }

    .result-item {
        flex-direction: column; /* Stack label and value */
        align-items: flex-start; /* Align items to start */
    }

    .result-item strong {
        text-align: left; /* Align value to left when stacked */
    }

    .site-footer-bottom {
        padding: 20px 15px; /* Reduce footer padding */
    }

    .footer-content {
        flex-direction: column; /* Stack footer content */
        text-align: center;
        gap: 20px; /* Reduce gap */
    }

    .contact-info, .legal-info {
        min-width: unset; /* Remove min-width */
    }
}

/* Small devices (phones, 600px and down) */
@media (max-width: 600px) {
    .lang-theme-bar {
        padding: 8px;
        gap: 5px;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .site-logo {
        max-height: 50px; /* Even smaller logo on phones */
    }

    .container {
        padding: 10px;
    }

    .verification-card {
        padding: 15px;
    }

    .verification-card h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .form-group input, .verify-btn {
        font-size: 0.95rem;
        padding: 10px 15px;
    }

    .results-header {
        padding: 10px;
    }

    .results-header .icon {
        font-size: 1.3rem;
    }

    .results-header h2 {
        font-size: 1.2rem;
    }

    .results-body {
        padding: 10px;
    }

    .result-item {
        padding: 10px 0;
        font-size: 0.95rem;
    }

    .site-footer-bottom {
        padding: 15px 10px;
    }

    .contact-info p, .legal-info p {
        font-size: 0.9rem;
    }

    .innov-link {
        font-size: 1rem;
        padding: 6px 20px;
    }
}

/* Extra small devices (portrait phones, less than 480px) */
@media (max-width: 480px) {
    .lang-theme-bar {
        flex-direction: column; /* Stack language and theme buttons */
        align-items: center;
    }

    .lang-btn {
        width: 100%; /* Full width for buttons */
        justify-content: center;
    }

    .site-logo {
        max-height: 40px;
    }

    .verification-card h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .form-group input, .verify-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .results-header h2 {
        font-size: 1.1rem;
    }

    .result-item {
        font-size: 0.9rem;
    }

    .innov-link {
        font-size: 0.9rem;
        padding: 5px 15px;
    }
}