/* Material Design Variables */
:root {
    --mdc-theme-primary: #2e7d32; /* Green */
    --mdc-theme-secondary: #03dac6;
    --mdc-theme-surface: #ffffff;
    --mdc-theme-background: #fafafa;
    --mdc-theme-error: #b00020;
    --mdc-text-primary-on-background: rgba(0, 0, 0, 0.87);
    --mdc-text-secondary-on-background: rgba(0, 0, 0, 0.6);
    --mdc-text-hint-on-background: rgba(0, 0, 0, 0.38);
    --mdc-shape-corner-small: 4px;
    --mdc-shape-corner-medium: 8px;
    --mdc-shape-corner-large: 12px;
    --mdc-elevation-shadow-1: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
    --mdc-elevation-shadow-2: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);

    --sf-surface: #ffffff;
    --sf-border: rgba(0, 0, 0, 0.1);
    --sf-badge-bg: #e6f4ea;
    --sf-badge-color: #1f7a3f;
    --sf-muted-bg: #eef0ec;
    --sf-muted-color: rgba(0, 0, 0, 0.45);
    --sf-text-muted: rgba(0, 0, 0, 0.6);
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--mdc-theme-background);
    color: var(--mdc-text-primary-on-background);
}

header {
    background-color: var(--mdc-theme-primary);
    color: white;
    font-weight: 500;
    padding: 1em;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--mdc-elevation-shadow-2);
    a {
        text-decoration: none;
        color: white;
        display: inline-flex;
        align-items: center;
    }
    .arrow-back {
        font-size: 1.5em;
        margin-right: 4px;
    }
}

@media (max-width: 600px) {
    header {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 0.6em 1em;
    }
}

h1, h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

main {
    margin: 1em;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.mdc-card {
    background-color: var(--mdc-theme-surface);
    border-radius: var(--mdc-shape-corner-medium);
    box-shadow: var(--mdc-elevation-shadow-1);
    padding: 1em;
    margin: 1em 0;
    width: 100%;
    max-width: 600px;
}

.mdc-card__content {
    padding: 0;
}

.mdc-button {
    background-color: var(--mdc-theme-primary);
    color: white;
    border: none;
    border-radius: var(--mdc-shape-corner-small);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: box-shadow 0.2s;
}

.mdc-button:hover {
    box-shadow: var(--mdc-elevation-shadow-2);
}

.mdc-button:disabled {
    background-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
}

.mdc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mdc-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mdc-list-item:last-child {
    border-bottom: none;
}

.mdc-typography--headline6 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 2rem;
    margin: 0 0 0.5rem 0;
}

.mdc-typography--body2 {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--mdc-text-secondary-on-background);
}

.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: var(--mdc-shape-corner-small);
    width: 100%;
    max-width: 600px;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.registration-form {
    width: 100%;
    max-width: 600px;
}

.form-field {
    margin-bottom: 1em;
}

.mdc-text-field {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--mdc-shape-corner-small);
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

.mdc-text-field:focus {
    outline: none;
    border-color: var(--mdc-theme-primary);
    box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.2);
}

/* Header pill buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    font-size: 0.9rem;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.btn-pill--light {
    background-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-pill--light:hover {
    background-color: rgba(255, 255, 255, 0.28);
}

/* Sorties falaise page */
.sf-page {
    width: 100%;
    max-width: 900px;
}

.sf-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5em;
    flex-wrap: wrap;
    margin-bottom: 1.5em;
}

.sf-intro__title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25em 0;
}

.sf-intro__subtitle {
    margin: 0;
    color: var(--mdc-text-secondary-on-background);
}

.sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.sf-btn .material-icons {
    font-size: 1.1em;
}

.sf-btn--primary {
    background-color: var(--mdc-theme-primary);
    color: #fff;
    transition: box-shadow 0.2s;
}

.sf-btn--primary:hover {
    box-shadow: var(--mdc-elevation-shadow-1);
}

.sf-btn--outline {
    background-color: transparent;
    color: var(--mdc-theme-primary);
    border: 1px solid var(--mdc-theme-primary);
}

.sf-btn--outline:hover {
    background-color: var(--sf-badge-bg);
}

.sf-section {
    margin-bottom: 2em;
}

.sf-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75em;
}

.sf-section__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.sf-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--sf-badge-bg);
    color: var(--sf-badge-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.sf-badge--muted {
    background-color: var(--sf-muted-bg);
    color: var(--sf-muted-color);
}

.sf-event-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.sf-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    background-color: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--mdc-shape-corner-medium);
    padding: 0.9em 1.1em;
}

.sf-event-card--closed .sf-event-date {
    background-color: var(--sf-muted-bg);
}

.sf-event-card--closed .sf-event-date__day,
.sf-event-card--closed .sf-event-date__month {
    color: var(--sf-muted-color);
}

.sf-event-card--closed .sf-event-title {
    color: var(--sf-text-muted);
}

.sf-event-card__main {
    display: flex;
    align-items: center;
    gap: 1em;
    min-width: 0;
}

.sf-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--sf-badge-bg);
    border-radius: var(--mdc-shape-corner-medium);
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.sf-event-date__day {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mdc-theme-primary);
    line-height: 1.1;
}

.sf-event-date__month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--mdc-theme-primary);
}

.sf-event-info {
    min-width: 0;
}

.sf-event-title {
    margin: 0 0 0.25em 0;
    font-weight: 600;
}

.sf-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    font-size: 0.8rem;
    color: var(--sf-text-muted);
}

.sf-event-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sf-event-meta__item .material-icons {
    font-size: 1rem;
}

.sf-event-action {
    flex-shrink: 0;
}

.sf-event-action__group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-empty {
    color: var(--sf-text-muted);
    font-style: italic;
}

@media (max-width: 600px) {
    .sf-intro {
        flex-direction: column;
    }

    .sf-intro .sf-btn--outline {
        width: 100%;
        justify-content: center;
    }

    .sf-event-card:not(.sf-event-card--badge-only) {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-event-card:not(.sf-event-card--badge-only) .sf-event-action {
        width: 100%;
    }

    .sf-event-card:not(.sf-event-card--badge-only) .sf-event-action .sf-btn {
        width: 100%;
        justify-content: center;
    }

    .sf-event-action__group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .sf-event-action__group .sf-badge {
        align-self: flex-start;
    }

    .sf-event-card--badge-only .sf-event-action {
        flex-shrink: 0;
    }

    .sf-event-card--badge-only .sf-event-card__main {
        min-width: 0;
    }

    .sf-event-card--badge-only .sf-event-title,
    .sf-event-card--badge-only .sf-event-meta {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Event detail / registrations page */
.sf-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--sf-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.25em;
}

.sf-breadcrumb:hover {
    color: var(--mdc-theme-primary);
}

.sf-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mdc-theme-primary);
    margin: 0 0 0.4em 0;
}

.sf-detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.6em 0;
}

.sf-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25em;
    color: var(--sf-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5em;
}

.sf-detail-meta .material-icons {
    font-size: 1.1rem;
    color: var(--mdc-theme-primary);
    vertical-align: text-bottom;
}

.sf-detail-note {
    margin: 0.5em 0 0 0;
    color: var(--sf-text-muted);
    font-size: 0.9rem;
}

.sf-registrants-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2em 0 1em 0;
}

.sf-registrants-header__title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-badge--lock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sf-badge--lock .material-icons {
    font-size: 1rem;
}

.sf-registrant-list {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.sf-registrant {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background-color: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--mdc-shape-corner-medium);
    padding: 0.75em 1em;
}

.sf-registrant__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--mdc-theme-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sf-registrant__info {
    display: flex;
    flex-direction: column;
}

.sf-registrant__name {
    font-weight: 600;
}

.sf-registrant__date {
    font-size: 0.8rem;
    color: var(--sf-text-muted);
}

.sf-registrant__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.sf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--sf-muted-bg);
    color: var(--mdc-text-primary-on-background);
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.sf-chip .material-icons {
    font-size: 1rem;
    color: var(--mdc-theme-primary);
}

.sf-chip--link {
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.sf-chip--link:hover,
.sf-chip--link:focus-visible {
    background-color: var(--mdc-theme-primary);
    color: #fff;
}

.sf-chip--link:hover .material-icons,
.sf-chip--link:focus-visible .material-icons {
    color: #fff;
}

.sf-empty-state {
    border: 1px dashed var(--sf-border);
    border-radius: var(--mdc-shape-corner-medium);
    padding: 3em 1.5em;
    text-align: center;
}

.sf-empty-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1em auto;
    border-radius: 50%;
    background-color: var(--sf-badge-bg);
    color: var(--mdc-theme-primary);
}

.sf-empty-state__icon .material-icons {
    font-size: 28px;
}

.sf-empty-state__title {
    font-weight: 700;
    color: var(--mdc-text-primary-on-background);
    margin: 0 0 0.25em 0;
}

.sf-empty-state__subtitle {
    margin: 0;
    color: var(--sf-text-muted);
    font-size: 0.9rem;
}

.sf-breadcrumb--bottom {
    display: inline-flex;
    margin-top: 1.5em;
    margin-bottom: 0;
}

.sf-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 16px;
    padding: 1.25em 1.5em;
    margin: 1.5em 0;
    width: 100%;
    max-width: 900px;
}

.sf-alert__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}

.sf-alert__message {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.sf-alert--success {
    background-color: var(--sf-badge-bg);
    color: var(--sf-badge-color);
}

.sf-alert--success .sf-alert__icon {
    background-color: var(--mdc-theme-primary);
}

.sf-alert--error {
    background-color: #fdecea;
    color: #b3261e;
}

.sf-alert--error .sf-alert__icon {
    background-color: #b3261e;
}

/* Header pill button icon + responsive label */
.btn-pill .material-icons {
    font-size: 1rem;
}

.btn-pill__short {
    display: none;
}

/* Header contextual back link */
.header-back__short {
    display: none;
}

/* Registration form */
.sf-card {
    background-color: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--mdc-shape-corner-medium);
    padding: 1.5em;
    max-width: 640px;
}

.sf-form-row {
    display: flex;
    gap: 1em;
}

.sf-form-row .sf-field {
    flex: 1;
    min-width: 0;
}

.sf-field {
    margin-bottom: 1.25em;
}

.sf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
}

.sf-required {
    color: var(--mdc-theme-error);
}

.sf-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--sf-border);
    border-radius: var(--mdc-shape-corner-small);
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

.sf-input::placeholder {
    color: var(--mdc-text-hint-on-background);
}

.sf-input:focus {
    outline: none;
    border-color: var(--mdc-theme-primary);
    box-shadow: 0 0 0 2px var(--sf-badge-bg);
}

.sf-field .form-error {
    margin: 0.4em 0 0 0;
    padding: 0;
    list-style: none;
    color: var(--mdc-theme-error);
    font-size: 0.8rem;
}

.sf-help {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0.4em 0 0 0;
    font-size: 0.8rem;
    color: var(--sf-text-muted);
}

.sf-help .material-icons {
    font-size: 0.95rem;
}

.sf-privacy-notice {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    margin-bottom: 1.25em;
}

.sf-privacy-notice .sf-help {
    margin: 0;
}

.sf-form-actions {
    display: flex;
    align-items: center;
    gap: 1.25em;
    flex-wrap: wrap;
    margin-top: 0.5em;
}

.sf-form-cancel {
    color: var(--sf-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.sf-form-cancel:hover {
    color: var(--mdc-theme-primary);
}

.sf-card-form-required-note-container {
    margin-bottom: 0.5rem;
}

.sf-form-required-note {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--sf-text-muted);
}

@media (max-width: 600px) {
    .sf-detail-meta {
        gap: 0.75em 1.25em;
    }

    .sf-registrant__contacts {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
    }

    .sf-chip {
        width: 100%;
    }

    .btn-pill__full {
        display: none;
    }

    .btn-pill__short {
        display: inline;
    }

    .header-back__full {
        display: none;
    }

    .header-back__short {
        display: inline;
    }

    .sf-card {
        max-width: none;
        padding: 1.25em;
    }

    .sf-form-row {
        flex-direction: column;
        gap: 0;
    }

    .sf-form-actions .sf-btn {
        width: 100%;
    }

    .sf-form-cancel {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 10px 20px;
        border: 1px solid var(--mdc-theme-primary);
        border-radius: 999px;
        color: var(--mdc-theme-primary);
        font-weight: 500;
        box-sizing: border-box;
        order: 2;
    }

    .sf-form-cancel:hover {
        background-color: var(--sf-badge-bg);
    }

    .sf-form-required-note {
        margin-left: 0;
        width: 100%;
        text-align: center;
        order: 3;
    }
}

/* Header login indicator (plain text on the login page itself) */
.header-login-plain {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Login page */
.sf-login-card {
    max-width: 440px;
    margin: 3em auto;
    text-align: center;
    padding: 2.5em 2em;
}

.sf-login-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25em auto;
    border-radius: var(--mdc-shape-corner-medium);
    background-color: var(--sf-badge-bg);
    color: var(--mdc-theme-primary);
}

.sf-login-card__icon .material-icons {
    font-size: 28px;
}

.sf-login-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.4em 0;
}

.sf-login-card__subtitle {
    margin: 0 0 1.5em 0;
    color: var(--sf-text-muted);
    font-size: 0.9rem;
}

.sf-login-card__alert {
    max-width: none;
    text-align: left;
    margin: 0 0 1.25em 0;
}

.sf-login-form {
    text-align: left;
}

.sf-login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.25em;
}

@media (max-width: 600px) {
    .sf-login-card {
        margin: 1.5em auto;
    }
}