/* ========================= */
/* VARIABLES GLOBALES */
/* ========================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;

    --danger: #dc2626;
    --danger-dark: #b91c1c;

    --success: #16a34a;
    --warning: #f97316;

    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.14);
}

/* ========================= */
/* BASE */
/* ========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
        radial-gradient(circle at bottom right, rgba(22, 163, 74, 0.07), transparent 32%),
        var(--bg);
    color: var(--text);
}

.hidden {
    display: none !important;
}

.app-container {
    width: min(1100px, 94%);
    margin: 0 auto;
    padding: 24px 0 50px;
}

/* ========================= */
/* HEADER */
/* ========================= */

.main-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.language-switcher {
    display: flex;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.25);
}

.brand h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 15px;
}

/* ========================= */
/* CARTES */
/* ========================= */

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 26px;
    margin-bottom: 22px;
}

/* ========================= */
/* AUTHENTIFICATION */
/* ========================= */

.auth-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 20px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    padding: 34px;
    border-radius: 28px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-logo {
    width: 74px;
    height: 74px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-bottom: 14px;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.28);
}

.auth-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.message {
    margin-top: 14px;
    color: var(--danger);
    font-weight: 600;
    text-align: center;
}

/* ========================= */
/* FORMULAIRES */
/* ========================= */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    transition: 0.2s ease;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-actions {
    margin-top: 4px;
}

/* ========================= */
/* BOUTONS */
/* ========================= */

.btn,
button {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

.btn-primary,
button:not(.danger):not(.btn-danger):not(.btn-secondary) {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover,
button:not(.danger):not(.btn-danger):not(.btn-secondary):hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
    background: #f8fafc;
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-danger,
.danger {
    background: linear-gradient(135deg, #ef4444, var(--danger));
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.btn-danger:hover,
.danger:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #dc2626, var(--danger-dark));
}

/* ========================= */
/* CARTE UTILISATEUR CONNECTÉ */
/* ========================= */

.user-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
        #ffffff;
    padding: 28px;
    border-radius: 26px;
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -70px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 50%;
}

.user-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.user-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
}

.user-text h2 {
    margin: 2px 0 8px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text);
}

.dashboard-label {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.connected-user-label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connected-user {
    margin: 4px 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.user-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.user-right {
    display: flex;
    align-items: center;
}

/* ========================= */
/* SECTION FORMULAIRE */
/* ========================= */

.form-card {
    padding: 26px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 26px;
}

.section-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 800;
}

/* ========================= */
/* LISTE DES TÂCHES */
/* ========================= */

.tasks-section {
    margin-top: 26px;
}

.list-heading {
    margin-bottom: 14px;
}

.tasks-list {
    display: grid;
    gap: 14px;
}

.task {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: 0.2s ease;
}

.task:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.task.done {
    opacity: 0.72;
    border-left-color: var(--success);
}

.task h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--text);
}

.task .meta,
.meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.task p {
    color: #334155;
    margin: 8px 0 14px;
}

.task button {
    margin-right: 8px;
    margin-top: 6px;
}

.empty-card {
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

.lang-btn {
    padding: 8px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-weight: 800;
    box-shadow: none;
}

.lang-btn:hover {
    background: #dbeafe;
}

.delete-account-card {
    border-left: 6px solid #dc2626;
}

.delete-account-card h2 {
    color: #dc2626;
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width: 800px) {
    .app-container {
        width: 94%;
        padding-top: 16px;
    }

    .brand h1 {
        font-size: 28px;
    }

    .brand p {
        font-size: 14px;
    }

    .auth-card {
        padding: 24px;
    }

    .auth-actions {
        flex-direction: column;
    }

    .user-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-left {
        align-items: flex-start;
    }

    .user-avatar {
        width: 62px;
        height: 62px;
        min-width: 62px;
        font-size: 28px;
    }

    .user-text h2 {
        font-size: 30px;
    }

    .connected-user {
        font-size: 20px;
    }

    .user-right {
        width: 100%;
    }

    .user-right .btn,
    .user-right button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
    }

    .sync-badge {
        width: fit-content;
    }
}

@media (max-width: 480px) {
    .card,
    .user-card,
    .form-card {
        padding: 20px;
        border-radius: 20px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
    }

    .user-left {
        flex-direction: column;
    }

    .user-text h2 {
        font-size: 28px;
    }

    .task button {
        width: 100%;
        margin-right: 0;
    }
}