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

:root {
    --gold: #d4a017;
    --gold-light: #f0c040;
    --gold-dark: #a07010;
    --green-deep: #0a1f0e;
    --green-dark: #112b16;
    --green-mid: #1a4825;
    --green-bright: #2d7a3a;
    --text-light: #e8f5e9;
    --text-muted: #8aba8e;
    --border: rgba(212, 160, 23, 0.3);
    --card-bg: rgba(10, 31, 14, 0.85);
    --radius: 12px;
    --mister: #4a90d9;
    --miss: #d46faa;
}

body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(180deg, #050e07 0%, #0a1f0e 100%);
    color: var(--text-light);
    min-height: 100vh;
}

.magic-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(45, 122, 58, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(212, 160, 23, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #050e07, #0a1f0e);
    pointer-events: none;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: rgba(10, 31, 14, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(212, 160, 23, 0.06);
    text-align: center;
    backdrop-filter: blur(16px);
}

.login-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    color: var(--gold);
}

.login-card h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 4px;
}

.login-sub {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.login-error {
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(192, 57, 43, 0.4);
    border-radius: 8px;
    padding: 10px 16px;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.login-field {
    margin-bottom: 18px;
    text-align: left;
}

.login-field label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text-light);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-bright));
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--green-bright), #3a9a4a);
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.2);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    font-family: 'Cinzel', serif;
}

.back-link:hover {
    color: var(--gold-light);
}

.admin-topbar {
    background: rgba(8, 24, 11, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(12px);
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold-light);
}

.admin-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-link {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.topbar-link:hover {
    color: var(--gold-light);
}

.logout-link:hover {
    color: #ff6b6b;
}

.admin-notification {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 500;
    background: rgba(10, 31, 14, 0.95);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.88rem;
    max-width: 320px;
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: none;
}

.admin-notification.show {
    display: block;
    transform: translateX(0);
}

.admin-notification.success {
    border-color: var(--gold);
    color: var(--gold-light);
}

.admin-notification.error {
    border-color: #c0392b;
    color: #ff6b6b;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.admin-controls-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 28px;
    backdrop-filter: blur(12px);
}

.admin-controls-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 20px;
}

.toggle-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toggle-label {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: var(--text-light);
    min-width: 80px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #aaa;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked+.slider {
    background: rgba(45, 122, 58, 0.4);
    border-color: var(--green-bright);
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(24px);
    background: var(--green-bright);
    box-shadow: 0 0 8px rgba(45, 122, 58, 0.6);
}

.toggle-status {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    min-width: 64px;
}

.toggle-status.open {
    color: var(--green-bright);
}

.toggle-status.closed {
    color: #ff6b6b;
}

/* ============================================================
   Bloc limite (input + bouton + compteur)
   ============================================================ */
.limit-block {
    gap: 10px;
}

.limit-input {
    width: 110px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 7px;
    padding: 8px 12px;
    color: var(--text-light);
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.limit-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.limit-input::-webkit-outer-spin-button,
.limit-input::-webkit-inner-spin-button {
    opacity: 0.6;
}

.limit-save-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-bright));
    border: 1px solid var(--gold-dark);
    border-radius: 7px;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s;
}

.limit-save-btn:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.18);
}

.limit-info {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 600;
    padding: 5px 10px;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: 6px;
    white-space: nowrap;
}

.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(10, 31, 14, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 2px 12px rgba(212, 160, 23, 0.15);
}

.badge {
    background: var(--gold-dark);
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
}

.badge-gray {
    background: rgba(255, 255, 255, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-list {
    text-align: center;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    padding: 40px;
    font-size: 0.9rem;
}

/* ============================================================
   Liste : 1 duo par ligne
   ============================================================ */
.inscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.duo-row {
    background: rgba(10, 31, 14, 0.55);
    border: 1px solid rgba(212, 160, 23, 0.18);
    border-radius: 14px;
    padding: 16px 18px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.duo-row:hover {
    border-color: rgba(212, 160, 23, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.duo-row.archived {
    opacity: 0.7;
}

.duo-row.archived:hover {
    opacity: 0.9;
}

.duo-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px 10px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.18);
}

.duo-row-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.duo-row-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
}

.duo-row-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ============================================================
   Carte individuelle (à l'intérieur d'une rangée de duo)
   ============================================================ */
.inscription-card {
    background: rgba(10, 31, 14, 0.75);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.3s;
}

.inscription-card:hover {
    border-color: rgba(212, 160, 23, 0.4);
    transform: translateY(-1px);
}

.inscription-card.archived {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.15);
}

.card-cat {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-light);
}

.card-body {
    margin-bottom: 12px;
}

.card-field {
    font-size: 0.85rem;
    margin: 5px 0;
    line-height: 1.4;
}

.field-label {
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-val {
    color: var(--text-light);
    margin-left: 4px;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions button {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.25s;
    min-width: 80px;
}

.btn-edit {
    background: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.4);
    color: #7ec8f0;
}

.btn-edit:hover {
    background: rgba(74, 144, 217, 0.25);
    border-color: #4a90d9;
}

.btn-archive {
    background: rgba(212, 160, 23, 0.08);
    border-color: rgba(212, 160, 23, 0.3);
    color: var(--gold-light);
}

.btn-archive:hover {
    background: rgba(212, 160, 23, 0.2);
    border-color: var(--gold);
}

.btn-restore {
    background: rgba(45, 122, 58, 0.1);
    border-color: rgba(45, 122, 58, 0.4);
    color: #7ac87a;
}

.btn-restore:hover {
    background: rgba(45, 122, 58, 0.25);
    border-color: var(--green-bright);
}

.btn-delete {
    background: rgba(192, 57, 43, 0.1);
    border-color: rgba(192, 57, 43, 0.35);
    color: #ff6b6b;
}

.btn-delete:hover {
    background: rgba(192, 57, 43, 0.25);
    border-color: #c0392b;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: #0e2815;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(212, 160, 23, 0.06);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-field label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.modal-field input,
.modal-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 7px;
    padding: 10px 12px;
    color: var(--text-light);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.modal-field select option {
    background: #0e2815;
}

.modal-field input:focus,
.modal-field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text-light);
}

.btn-save {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-bright));
    border: 1px solid var(--gold-dark);
    border-radius: 7px;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.2);
}

@media (max-width: 700px) {
    .duo-row-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .admin-container {
        padding: 16px 12px 40px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-logo {
        font-size: 0.9rem;
    }

    .admin-sub {
        display: none;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .toggle-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .duo-row {
        padding: 14px;
    }

    .duo-row-title {
        font-size: 0.95rem;
    }

    .limit-input {
        width: 90px;
    }
}