:root {
    --bg: #eef3ea;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: rgba(255, 255, 255, 0.72);
    --border: #dbe5d6;
    --text: #1d2a22;
    --muted: #617064;
    --green: #3f7f53;
    --green-dark: #2e6140;
    --green-soft: #e6f0e5;
    --blue-soft: #e8f0f6;
    --danger-soft: #fbe8e8;
    --shadow: 0 14px 35px rgba(31, 42, 34, 0.10);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    color: var(--text);
    background: url('../bg-nature-v2.png') center center / cover no-repeat fixed;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
    padding: 18px;
}

.sidebar {
    background: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(219, 229, 214, 0.9);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(8px);
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: inset 0 0 0 1px #e5ece0;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #17375b;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav a {
    text-decoration: none;
    color: #385247;
    padding: 14px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.nav a.active {
    background: var(--green-soft);
    color: var(--green-dark);
}

.nav a:hover {
    background: #f2f7f1;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-note {
    background: #edf5ea;
    border: 1px solid #dbe7d8;
    border-radius: 18px;
    padding: 16px;
    color: #486050;
    line-height: 1.45;
    font-size: 14px;
}

.sidebar-logout {
    text-decoration: none;
    color: #385247;
    padding: 14px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.sidebar-logout:hover {
    background: #f2f7f1;
}

.main {
    padding-right: 8px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(219, 229, 214, 0.92);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.card-strong {
    background: var(--panel-strong);
    backdrop-filter: blur(8px);
}

h1, h2, h3 {
    margin-top: 0;
}

.hero {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 22px;
    align-items: stretch;
}

.hero-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hero-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    box-shadow: inset 0 0 0 1px #e6ece3;
    flex-shrink: 0;
}

.hero-title {
    font-size: 34px;
    margin: 0 0 6px 0;
    color: #17375b;
    line-height: 1.1;
}

.hero-subtitle {
    color: #52655a;
    font-size: 16px;
    line-height: 1.45;
}

.hero-user {
    color: #5f7064;
    font-size: 15px;
}

.ecolab-badge {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(255,255,255,0.88);
    border: 1px solid #dbe5d6;
    border-radius: 18px;
    padding: 18px 20px;
    min-height: 100%;
}

.ecolab-badge img {
    max-height: 76px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.ecolab-badge-text {
    font-size: 15px;
    color: #4d5f53;
    line-height: 1.45;
}

.ecolab-badge-text strong {
    display: block;
    color: #172a1f;
    margin-bottom: 6px;
    font-size: 17px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 20px;
}

.metric {
    font-size: 56px;
    font-weight: 800;
    color: var(--green-dark);
    line-height: 1;
    margin: 10px 0 14px;
}

.metric-sub {
    color: #53705f;
    font-size: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #66b85c;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 14px;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #e4ebe1;
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(236, 243, 234, 0.95);
    color: #31483e;
}

.empty {
    color: var(--muted);
    font-style: italic;
}

.form-card {
    padding-top: 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid-2-uneven {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid-3-tight {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 6px;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #324a3e;
}

input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d4ded1;
    border-radius: 14px;
    background: rgba(255,255,255,0.88);
    color: var(--text);
}

textarea {
    min-height: 86px;
    resize: vertical;
}

.add-trip-submit {
    min-width: 175px;
    justify-content: center;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--green-dark);
}

.btn-secondary {
    background: rgba(255,255,255,0.82);
    color: #22352b;
    border-color: #d8e1d4;
}

.btn-secondary:hover {
    background: #fff;
}

.table-card table {
    background: rgba(255,255,255,0.70);
    border-radius: 16px;
    overflow: hidden;
}

.table-card tbody tr:hover {
    background: rgba(234, 243, 232, 0.55);
}

.mode-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #edf5ea;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.action-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    border: 1px solid transparent;
}

.icon-btn.edit {
    background: #e8f1e8;
    color: #2f6b43;
    border-color: #d5e5d7;
}

.icon-btn.delete {
    background: #fbe9e9;
    color: #b84b4b;
    border-color: #f1d5d5;
}

.table-footer {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.fake-more-btn {
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid #d8e1d4;
    background: rgba(255,255,255,0.85);
    color: #43584d;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .hero,
    .grid,
    .form-grid-2,
    .form-grid-2-uneven,
    .form-grid-3-tight {
        grid-template-columns: 1fr;
    }

    .add-trip-submit {
        width: 100%;
    }
}
.hero-single {
    grid-template-columns: 1fr;
}

.podium-card {
    background: rgba(255, 255, 255, 0.90);
}

.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.podium-item {
    border-radius: 22px;
    padding: 24px 20px;
    border: 1px solid rgba(219, 229, 214, 0.95);
    box-shadow: 0 10px 24px rgba(31, 42, 34, 0.08);
    background: rgba(255,255,255,0.92);
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.podium-gold {
    background: linear-gradient(180deg, rgba(255, 248, 220, 0.98), rgba(255,255,255,0.92));
    border-color: #ead27a;
}

.podium-silver {
    background: linear-gradient(180deg, rgba(242, 244, 247, 0.98), rgba(255,255,255,0.92));
    border-color: #d5dae3;
}

.podium-bronze {
    background: linear-gradient(180deg, rgba(242, 224, 210, 0.98), rgba(255,255,255,0.92));
    border-color: #d9b49b;
}

.podium-medal {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 10px;
}

.podium-rank {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #4b5c50;
}

.podium-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #1d2a22;
    word-break: break-word;
}

.podium-distance {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-dark);
}

.mode-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.mode-preview-card {
    background: rgba(255, 255, 255, 0.92);
}

.mode-details {
    margin-top: 14px;
    border-top: 1px solid #e4ebe1;
    padding-top: 12px;
}

.mode-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #395247;
    list-style: none;
}

.mode-details summary::-webkit-details-marker {
    display: none;
}

.mode-details summary::after {
    content: " ⌄";
}

.mode-full-table {
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .podium-grid,
    .mode-preview-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   PAGE D'ACCUEIL / CONNEXION
========================================================= */

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-grid {
    width: 100%;
    max-width: 1180px;
    display: grid;
    grid-template-columns: 1.15fr 0.75fr;
    gap: 28px;
    align-items: start;
}

.auth-hero-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(8px);
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.auth-title {
    font-size: 54px;
    line-height: 1;
    margin: 0 0 10px 0;
    color: #17375b;
    font-weight: 800;
}

.auth-subtitle {
    color: #52655a;
    font-size: 17px;
    line-height: 1.5;
    max-width: 760px;
}

.auth-features {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(219, 229, 214, 0.9);
    border-radius: 20px;
    padding: 22px;
}

.feature-list {
    margin: 14px 0 0 0;
    padding-left: 20px;
    color: #485b4e;
    line-height: 1.7;
    font-size: 15px;
}

.auth-ecolab {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(219, 229, 214, 0.9);
    border-radius: 20px;
    padding: 18px 20px;
}

.auth-ecolab img {
    max-height: 78px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.auth-ecolab-text {
    font-size: 15px;
    color: #4d5f53;
    line-height: 1.45;
}

.auth-ecolab-text strong {
    display: block;
    color: #172a1f;
    margin-bottom: 6px;
    font-size: 17px;
}

.auth-form-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(8px);
    min-height: 100%;
    padding-top: 28px;
    padding-bottom: 28px;
}

.login-intro {
    margin: 0 0 18px 0;
    color: #5a6c60;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form input[type="email"] {
    width: 100%;
}

.login-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(237, 245, 234, 0.82);
    border: 1px solid #dbe7d8;
    color: #486050;
    font-size: 14px;
    line-height: 1.45;
}

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-error {
    background: rgba(251, 232, 232, 0.96);
    border: 1px solid #e6bcbc;
    color: #8a3838;
}

.btn.btn-lg {
    min-height: 52px;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 980px) {
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-title {
        font-size: 42px;
    }
}

@media (max-width: 640px) {
    .auth-shell {
        padding: 18px 14px;
    }

    .auth-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-title {
        font-size: 34px;
    }

    .auth-subtitle {
        font-size: 15px;
    }

    .auth-ecolab {
        flex-direction: column;
        align-items: flex-start;
    }
}}