/* Portail SAD - Styles Mobile-First */

:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #E3F2FD;
    --danger: #C62828;
    --danger-light: #FFEBEE;
    --warning: #F57C00;
    --warning-light: #FFF3E0;
    --success: #2E7D32;
    --text: #212121;
    --text-light: #757575;
    --background: #FAFAFA;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 20px -20px;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-group {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-logout:active {
    background: rgba(255,255,255,0.3);
}

/* Login Page */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-form {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    background: var(--white);
    transition: border-color 0.2s;
}

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

.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.1s, background 0.2s;
}

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

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

.btn-primary:active {
    background: var(--primary-dark);
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    flex: 1;
}

.app-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.1s, box-shadow 0.2s;
}

.app-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.app-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.app-card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-card-content p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Security Banner */
.security-banner {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
}

.security-banner strong {
    color: var(--warning);
}

/* Footer Nav */
.footer-nav {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
}

.footer-nav a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

/* About Page */
.about-section {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.about-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.about-section p {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 8px;
}

.about-section ul {
    list-style: none;
    margin-top: 12px;
}

.about-section li {
    padding: 12px 0;
    border-bottom: 1px solid #EEE;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.about-section li:last-child {
    border-bottom: none;
}

.about-section li span.icon {
    font-size: 1.2rem;
}

/* Security Rules - Highlighted */
.security-rules {
    background: var(--danger-light);
    border: 2px solid var(--danger);
}

.security-rules h2 {
    color: var(--danger);
}

.security-rules li {
    color: var(--danger);
    font-weight: 500;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Responsive - Tablet+ */
@media (min-width: 600px) {
    .container {
        padding: 24px;
    }

    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
    }

    .app-icon {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
}
