:root {
    --app-radius: 0.625rem;
    --app-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.07);

    /* Brand — blue */
    --brand: #2274A5;
    --brand-dark: #1a5f85;
    --brand-rgb: 34, 116, 165;

    /* Bootstrap primary overrides */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-hover-color-rgb: 26, 95, 133;
}

/* Button overrides */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: #154d6b;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: var(--brand);
}

.badge.bg-primary { background-color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }

body {
    min-height: 100vh;
    background-color: #f4f6f8;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    box-shadow: var(--app-shadow);
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.app-navbar {
    background: #fff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.app-brand {
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.app-brand__logo {
    display: block;
    height: 2.5rem;
    width: auto;
    max-width: 10rem;
    object-fit: contain;
}

.app-navbar .nav-link {
    color: #2c3e4a;
    font-weight: 500;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand-dark);
    border-radius: 0.375rem;
}

.app-navbar .nav-link.active {
    color: var(--brand);
    font-weight: 600;
}

.app-main {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.auth-card {
    border: none;
    border-radius: var(--app-radius);
}

.card {
    border: none;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.page-header h1 {
    font-weight: 700;
}

.user-menu-toggle {
    opacity: 0.95;
}

.profile-dropdown {
    min-width: 18rem;
    border: none;
    border-radius: var(--app-radius);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.profile-dropdown-header {
    border-bottom: 1px solid #e9ecef;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
}

.stat-card .stat-icon {
    font-size: 1.75rem;
    color: var(--brand);
    opacity: 0.18;
    line-height: 1;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.concours-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-bottom-width: 1px;
}

.concours-details dt {
    color: #6c757d;
    font-weight: 500;
}

.view-toggle .btn {
    min-width: 7rem;
}

.calendar-card {
    overflow: hidden;
}

.calendar-nav {
    padding: 1rem 1.25rem;
}

.calendar-compact {
    display: flex;
    flex-direction: column;
}

.calendar-compact-day {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.calendar-compact-day:last-child {
    border-bottom: none;
}

.calendar-compact-day--today {
    background: #f0f6ff;
}

.calendar-compact-date {
    flex: 0 0 3.5rem;
    text-align: center;
    line-height: 1.2;
}

.calendar-compact-weekday {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.03em;
}

.calendar-compact-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.calendar-compact-day--today .calendar-compact-number {
    color: var(--brand);
}

.calendar-compact-month {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: capitalize;
}

.calendar-compact-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.calendar-event {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.82rem;
    line-height: 1.25;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    background: #e7f1ff;
}

.calendar-event:hover {
    background: #d0e4ff;
    color: inherit;
}

.calendar-event--validee {
    border-left-color: #198754;
    background: #e8f5ee;
}

.calendar-event--validee:hover {
    background: #d1ebdc;
}

.calendar-event--reportee {
    border-left-color: #ffc107;
    background: #fff8e1;
}

.calendar-event--reportee:hover {
    background: #ffefb8;
}

.calendar-event--annulee {
    border-left-color: #dc3545;
    background: #fde8ea;
    opacity: 0.75;
    text-decoration: line-through;
}

.calendar-event--inscrit {
    box-shadow: inset 0 0 0 1px #198754;
    font-weight: 600;
}

.calendar-event--entrainement {
    border-left-color: #6f42c1;
    background: #f3ebff;
}

.calendar-event--entrainement:hover {
    background: #e8d9ff;
}

.calendar-event--evenement {
    border-left-color: #fd7e14;
    background: #fff3e6;
}

.calendar-event--evenement:hover {
    background: #ffe8cc;
}

.calendar-event--participe {
    box-shadow: inset 0 0 0 1px #198754;
    font-weight: 600;
}

.calendar-event--organisateur {
    box-shadow: inset 0 0 0 1px #6c757d;
}

.calendar-event-name {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-meta {
    display: block;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-inscrits {
    display: block;
    margin-top: 0.15rem;
    color: #495057;
    font-size: 0.75rem;
    line-height: 1.3;
}

.inscrits-badges {
    margin-top: 0.35rem;
}

.inscrits-badges .badge {
    font-weight: 500;
}

.calendar-legend {
    font-size: 0.85rem;
    color: #6c757d;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.15rem;
    display: inline-block;
}

.legend-dot--validee { background: #198754; }
.legend-dot--reportee { background: #ffc107; }
.legend-dot--annulee { background: #dc3545; }
.legend-dot--inscrit { background: #fff; box-shadow: inset 0 0 0 2px #198754; }
.legend-dot--entrainement { background: #6f42c1; }
.legend-dot--evenement { background: #fd7e14; }
.legend-dot--participe { background: #fff; box-shadow: inset 0 0 0 2px #198754; }
.legend-dot--organisateur { background: #fff; box-shadow: inset 0 0 0 2px #6c757d; }

.text-pre-line {
    white-space: pre-line;
}

.text-pre-wrap {
    white-space: pre-wrap;
}

.invite-picker-list {
    max-height: 18rem;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    background: #fafbfc;
}

.invite-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
}

.invite-picker-item:last-child {
    border-bottom: none;
}

.invite-picker-item:hover {
    background: #f0f4f8;
}

.invite-picker-item[hidden] {
    display: none;
}

.invite-picker-checkbox {
    width: 1rem;
    height: 1rem;
    margin: 0.15rem 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.invite-picker-label {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.invite-picker-name {
    font-weight: 500;
}

.timetable-card {
    overflow: hidden;
}

.timetable-nav {
    padding: 1rem 1.25rem;
}

.timetable-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.timetable {
    min-width: 52rem;
    background: #fff;
    border-top: 1px solid #dee2e6;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

table.timetable .timetable-col-hour {
    width: 3.25rem;
}

table.timetable th,
table.timetable td {
    vertical-align: top;
}

table.timetable thead tr {
    border-bottom: 2px solid #dee2e6;
}

.timetable-corner {
    border-right: 1px solid #dee2e6;
    background: #f8f9fa;
}

.timetable-head {
    padding: 0.65rem 0.35rem;
    text-align: center;
    border-right: 1px solid #dee2e6;
    background: #f8f9fa;
    line-height: 1.2;
}

.timetable-head--today {
    background: #e8f1ff;
    box-shadow: inset 0 -3px 0 var(--brand);
}

.timetable-head--past {
    color: #adb5bd;
}

.timetable-head-weekday {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
}

.timetable-head-date {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #212529;
}

.timetable-head--today .timetable-head-date {
    color: var(--brand);
}

.timetable-hour-label {
    padding: 0.35rem 0.45rem 0.35rem 0;
    text-align: right;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #e9ecef;
    background: #fafbfc;
    min-height: 3.25rem;
}

.timetable-hour-label--allday {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-height: 2.75rem;
}

.timetable-cell {
    padding: 0.2rem;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    min-height: 3.25rem;
    background: #fff;
}

.timetable-cell--allday {
    min-height: 2.75rem;
    background: #fcfcfd;
}

.timetable-cell--today {
    background: #f7faff;
}

.timetable-cell--past {
    background: #fafafa;
}

.timetable-event {
    display: block;
    margin-bottom: 0.2rem;
    padding: 0.28rem 0.38rem;
    border-radius: 0.25rem;
    border-left: 3px solid transparent;
    font-size: 0.72rem;
    line-height: 1.25;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.timetable-event:last-child {
    margin-bottom: 0;
}

.timetable-event:hover {
    color: inherit;
    filter: brightness(0.97);
}

.timetable-event--entrainement {
    border-left-color: #6f42c1;
    background: #f3ebff;
}

.timetable-event--evenement {
    border-left-color: #fd7e14;
    background: #fff3e6;
}

.timetable-event--participe {
    box-shadow: inset 0 0 0 1px #198754;
}

.timetable-event--organisateur {
    box-shadow: inset 0 0 0 1px #6c757d;
}

.timetable-event-time {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.timetable-event-title {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timetable-event-meta {
    display: block;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Roboto", system-ui, -apple-system, sans-serif;
    background-color: #123d54;
    background-image:
        url("../images/backgroud.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.page-public .app-main--landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: transparent;
}

.page-public .app-main--landing > .alert {
    max-width: 32rem;
    width: calc(100% - 2rem);
    margin: 1rem auto 0;
}

.page-public .app-brand__logo {
    height: 2.35rem;
    max-width: 9.5rem;
}

.landing-logo {
    display: block;
    width: min(100%, 16rem);
    height: auto;
    margin: 0 auto 1rem;
}

.landing-logo--compact {
    width: min(100%, 12rem);
    margin-bottom: 0.85rem;
}

.landing-brand {
    font-family: "Titan One", cursive;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--brand-dark);
}

.landing-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(1.25rem, 4vh, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.landing-card {
    width: 100%;
    max-width: 40rem;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.35);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.landing-card--auth {
    max-width: 26rem;
}

.landing-register {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.page-public .landing-page {
    align-items: flex-start;
    padding-top: clamp(1rem, 3vh, 2rem);
    padding-bottom: clamp(1rem, 3vh, 2rem);
    overflow-y: auto;
}

.page-public {
    overflow-y: auto;
}

.landing-card--register {
    max-width: 36rem;
}

.landing-card__body .form-label {
    font-weight: 500;
    color: #374151;
}

.landing-card__body .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.2);
}

.club-picker-inline-row {
    margin-bottom: 0.75rem !important;
}

.club-picker-inline-row .form-label {
    font-size: 0.8rem;
}

.club-picker-inline-row .form-select {
    font-size: 0.85rem;
}

.landing-card__header {
    margin-bottom: 1.5rem;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 0.5rem 1.25rem rgba(var(--brand-rgb), 0.4);
    margin-bottom: 1rem;
}

.landing-title {
    font-size: clamp(1.5rem, 3.5vw, 1.9rem);
    font-weight: 700;
    color: #1d2b22;
    margin-bottom: 0.5rem;
}

.landing-title .landing-brand {
    font-size: clamp(1.85rem, 4.5vw, 2.35rem);
    color: var(--brand);
}

.landing-lead {
    font-size: 1.05rem;
    font-weight: 500;
    color: #4a5560;
    margin-bottom: 0;
}

.landing-lead .landing-brand {
    font-size: 1.2rem;
    color: var(--brand-dark);
}

.landing-card__body .landing-brand {
    font-size: 1.05em;
}

.landing-card__footer .landing-brand {
    font-size: 1em;
}

.landing-card__body {
    color: #4a5560;
    font-size: 0.95rem;
    line-height: 1.6;
}

.landing-card__body p {
    margin-bottom: 0.85rem;
}

.landing-outro {
    font-weight: 600;
    color: #1d2b22;
    margin-bottom: 0 !important;
}

.landing-cta {
    margin-bottom: 0.25rem;
}

.landing-cta a {
    color: var(--brand);
    font-size: 0.95rem;
}

.landing-cta a:hover {
    color: var(--brand-dark);
}

.landing-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.landing-card__actions .btn {
    flex: 1 1 12rem;
}

.landing-note {
    margin-top: 1rem;
    margin-bottom: 0;
    text-align: center;
    font-size: 0.82rem;
    color: #8a939c;
}

.landing-card__footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.landing-card__footer a {
    color: #8a939c;
    text-decoration: none;
}

.landing-card__footer a:hover {
    color: var(--brand);
}

@media (max-width: 768px) {
    .landing-card__actions .btn {
        flex-basis: 100%;
    }

    .landing-card__body {
        font-size: 0.9rem;
    }

    .landing-card--auth,
    .landing-card--register {
        max-width: 100%;
    }

    .page-public .app-main--landing > .alert {
        width: calc(100% - 1.5rem);
    }

    .calendar-compact-day {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .calendar-compact-date {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
        flex: none;
        text-align: left;
    }

    .calendar-compact-number {
        font-size: 1.15rem;
    }

    .calendar-compact-weekday,
    .calendar-compact-month {
        display: inline;
        font-size: 0.8rem;
    }

    .calendar-event {
        font-size: 0.78rem;
        padding: 0.35rem 0.5rem;
    }

    .calendar-nav .h5 {
        font-size: 1rem;
    }
}

.archer-avatar {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    font-size: 1.25rem;
}

.avatar-crop-stage {
    position: relative;
    width: 220px;
    height: 220px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 50%;
    background: #e9ecef;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08);
    user-select: none;
}

.avatar-crop-stage:active {
    cursor: grabbing;
}

.avatar-crop-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    pointer-events: none;
}
