/**
 * ============================================================
 * TRICAM - STYLES GLOBAUX
 * ============================================================
 * Styles communs à toutes les pages de l'application
 * ============================================================
 */

/* Reset de base déjà dans variables.css */

/* ============================================================
   LAYOUT GÉNÉRAL
   ============================================================ */

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    min-height: 100vh;
}

.container {
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ============================================================
   HEADER STICKY (Questionnaires)
   ============================================================ */

.header-sticky {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: var(--shadow-md);
    z-index: var(--z-sticky);
    margin-bottom: 2rem;
}

.header-content {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--inrh-red);
    margin-bottom: 0.25rem;
}

.header-left p {
    color: var(--gray-600);
    font-size: var(--text-sm);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.header-logo {
    max-height: 36px;
    width: auto;
    display: block;
}

.user-name {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    font-size: var(--text-sm);
}

/* Consigne sticky (apparaît au scroll) */
.header-consigne {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-align: center;
    max-height: 0;
    overflow: hidden;
    padding: 0 2rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.header-consigne.visible {
    max-height: 6rem;
    padding: 0.5rem 2rem;
}

/* Barre de progression */
.progress-bar {
    height: 6px;
    background: var(--gray-200);
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--inrh-red), var(--inrh-red-dark));
    transition: width 0.3s ease;
}

/* ============================================================
   HEADER PAGE D'ACCUEIL
   ============================================================ */

.page-header {
    background: linear-gradient(135deg, var(--inrh-red), var(--inrh-red-dark));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.page-header .logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    margin-bottom: 0.5rem;
    font-weight: var(--font-black);
}

.page-header p {
    font-size: var(--text-lg);
    opacity: 0.95;
    line-height: var(--leading-relaxed);
}

/* ============================================================
   FOOTER
   ============================================================ */

.page-footer {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--gray-600);
    font-size: var(--text-sm);
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 20px 20px;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    line-height: var(--leading-relaxed);
}

.alert-error {
    background: var(--error-bg);
    border-left: 4px solid var(--error);
    color: var(--error);
}

.alert-success {
    background: var(--success-bg);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    color: var(--info);
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

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

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

.form-group label .required {
    color: var(--inrh-red);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--inrh-red);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--inrh-red);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--inrh-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
}

.nav-buttons .btn {
    flex: 1;
}

/* ============================================================
   INFO BOXES
   ============================================================ */

.info-box {
    background: var(--gray-50);
    border-left: 4px solid var(--inrh-red);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.info-box h3 {
    color: var(--gray-900);
    margin-bottom: 1rem;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: var(--leading-relaxed);
}

.info-box li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--inrh-red);
    font-weight: var(--font-bold);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-body {
    padding: 2rem;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.badge-primary {
    background: var(--inrh-red);
    color: white;
}

.info-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .header-left h1 {
        font-size: var(--text-xl);
    }

    .page-header {
        padding: 2rem 1rem;
        border-radius: 0;
    }

    .page-header h1 {
        font-size: var(--text-2xl);
    }

    .nav-buttons {
        flex-direction: column;
    }

    .page-footer {
        border-radius: 0;
    }
}

/* Utilitaire */
.hidden { display: none !important; }
