@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Logo Colors */
    --logo-mauve: #8A64B2;
    --logo-mauve-dark: #4A2B6E;
    --logo-green: #B2D25B;
    --logo-yellow: #F0CC5F;

    /* M3 System Colors (Mapped) */
    --md-sys-color-primary: var(--logo-mauve);
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: var(--logo-mauve-dark);
    
    --md-sys-color-secondary: var(--logo-green);
    --md-sys-color-on-secondary: #2C3C00;
    --md-sys-color-secondary-container: #D7F97A;
    --md-sys-color-on-secondary-container: #1C2600;

    --md-sys-color-surface: #FCF7FF;
    --md-sys-color-on-surface: #1D1B20;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: rgba(138, 100, 178, 0.3);

    font-family: 'Outfit', sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Very expressive gradient with Mauve, Green, Yellow touches */
    background: radial-gradient(circle at top left, #F2E7FE 0%, #FCF7FF 40%, #EDF7D2 100%);
    color: var(--md-sys-color-on-surface);
}

/* Typography fix: Outfit for standard elements, NOT for icons! */
*:not(md-icon):not(.material-symbols-outlined) {
    font-family: 'Outfit', sans-serif !important;
}

md-icon {
    font-family: 'Material Symbols Outlined' !important;
}

/* App Bar - Classic Top snap */
.app-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(138, 100, 178, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.logo-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(101, 70, 135, 0.15));
    /* hide broken image icon gently */
    color: transparent;
}

.titles h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--logo-mauve-dark);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    margin-top: 2px;
}

#total-members-count {
    color: var(--logo-mauve);
    font-weight: 700;
}

#btn-admin {
    --md-filled-button-container-shape: 100px;
    --md-sys-color-primary: var(--logo-mauve-dark);
    height: 40px;
    font-size: 14px;
}

#btn-show-members {
    --md-filled-icon-button-container-shape: 100px;
    --md-sys-color-primary: var(--logo-mauve-dark);
}

/* Main Content Layouts */
.main-content {
    flex: 1;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    box-sizing: border-box;
}

.double-column {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
}

/* Glassmorphism General Cards */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 40px;
    padding: 40px;
    box-shadow: 0 24px 48px -12px rgba(138, 100, 178, 0.12), 
                0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    width: 100%;
    box-sizing: border-box;
}

/* Left Column: Benefits Card */
.benefits-card {
    background: linear-gradient(135deg, var(--logo-mauve-dark) 0%, #654687 100%);
    color: #ffffff;
    border-radius: 32px;
    padding: 48px;
    box-shadow: 0 24px 64px -12px rgba(74, 43, 110, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: none;
}

.benefits-card h2 {
    color: #ffffff;
    text-align: left;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

.badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--logo-green);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    align-self: flex-start;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.benefits-intro {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 40px;
    margin-top: 0;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.benefit-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.benefit-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.1);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    flex-shrink: 0;
}

.benefit-text h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--logo-green);
}

.benefit-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

/* Right Column: Premium Form Card */
.form-card {
    background: #ffffff;
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 24px 64px -12px rgba(138, 100, 178, 0.08);
}

.form-card h2 {
    color: var(--logo-mauve-dark);
    margin-top: 0;
    margin-bottom: 28px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Typography elements */
.section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--logo-mauve-dark);
    margin-bottom: -12px;
    display: block;
}

/* Modern Outlined Fields & Focus Animation */
md-outlined-text-field {
    width: 100%;
    --md-outlined-text-field-container-shape: 20px;
    --md-sys-color-primary: var(--logo-mauve);
    --md-sys-color-outline: rgba(138, 100, 178, 0.4);
    transition: transform 0.2s ease;
}

md-outlined-text-field:focus-within {
    transform: translateY(-2px);
}

/* Custom Horizontal Segmented Control Selector */
.segmented-control {
    display: flex;
    position: relative;
    background: rgba(138, 100, 178, 0.06);
    border-radius: 16px;
    padding: 4px;
    user-select: none;
    border: 1px solid rgba(138, 100, 178, 0.1);
}

.segmented-control input[type="radio"] {
    display: none;
}

.segment-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--logo-mauve-dark);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    border-radius: 12px;
}

.segment-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(138, 100, 178, 0.12);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.segmented-control.three-segments .segment-slider {
    width: calc(33.333% - 4px);
}

#statut-classique:checked ~ .segment-slider {
    transform: translateX(0);
}

#statut-actif:checked ~ .segment-slider {
    transform: translateX(100%);
}

#statut-ca:checked ~ .segment-slider {
    transform: translateX(200%);
}

#statut-classique:checked ~ label[for="statut-classique"],
#statut-actif:checked ~ label[for="statut-actif"],
#statut-ca:checked ~ label[for="statut-ca"] {
    color: var(--logo-mauve);
}

.donation-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0;
    transition: all 0.3s ease;
}

/* Plants Subcard & Group */
.plants-subcard {
    box-sizing: border-box;
    width: 100%;
    padding: 0;
}

.plants-stepper-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    width: 100%;
}

.plants-stepper-container md-outlined-text-field {
    flex: 1;
    --md-outlined-text-field-input-text-align: center;
}

.plants-stepper-container md-outlined-text-field::part(input) {
    text-align: center;
}

.plants-stepper-container md-outlined-icon-button {
    --md-outlined-icon-button-container-shape: 16px;
    flex-shrink: 0;
}

.section-desc {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: -12px;
    margin-bottom: 4px;
    line-height: 1.4;
    text-align: left;
}

.donation-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--logo-mauve-dark);
    border-bottom: 1px solid rgba(138, 100, 178, 0.1);
    padding-bottom: 12px;
    text-align: left;
}

/* Panel Disabled state */
.disabled-panel {
    opacity: 0.45;
    filter: grayscale(1);
    pointer-events: none;
}

/* Euros selectable Grid & Radio Pills */
.euros-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}

.euros-grid input[type="radio"] {
    display: none;
}

.pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: #ffffff;
    border: 1px solid rgba(138, 100, 178, 0.2);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    color: var(--logo-mauve-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.pill-btn:hover {
    background: rgba(138, 100, 178, 0.05);
    border-color: var(--logo-mauve);
}

#euro-0:checked ~ label[for="euro-0"],
#euro-5:checked ~ label[for="euro-5"],
#euro-10:checked ~ label[for="euro-10"],
#euro-20:checked ~ label[for="euro-20"],
#euro-50:checked ~ label[for="euro-50"],
#euro-100:checked ~ label[for="euro-100"],
#euro-500:checked ~ label[for="euro-500"] {
    background: var(--logo-mauve);
    color: #ffffff;
    border-color: var(--logo-mauve);
    box-shadow: 0 4px 12px rgba(138, 100, 178, 0.2);
}

/* IBAN Utilities */
.iban-utility {
    border: 2px dashed rgba(138, 100, 178, 0.25);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.iban-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.iban-text {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 15px;
    font-weight: 700;
    color: var(--logo-mauve-dark);
    letter-spacing: 0.5px;
    text-align: center;
    word-break: break-all;
}

#btn-copy-iban {
    --md-sys-color-primary: var(--logo-mauve);
    font-weight: 600;
    height: 36px;
}

#btn-copy-iban.copied-success {
    --md-sys-color-primary: #2e7d32 !important;
}

/* Form Action Buttons */
.form-actions {
    display: flex;
    justify-content: stretch;
    margin-top: 8px;
}

#btn-save {
    width: 100%;
    height: 56px;
    --md-filled-button-container-shape: 20px;
    --md-sys-color-primary: var(--logo-mauve);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(138, 100, 178, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

#btn-save:active {
    transform: scale(0.98);
}

.error-msg {
    color: #BA1A1A;
    font-size: 14px;
    margin-top: 8px;
    min-height: 20px;
    text-align: center;
}

/* Admin Card */
.admin-card {
    max-width: 1000px;
    width: 100%;
    padding: 40px;
}

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

.admin-header h2 {
    margin-bottom: 0;
}

#btn-logout {
    --md-sys-color-primary: var(--logo-mauve-dark);
}

/* Table */
.members-table-container {
    overflow-x: auto;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

th, td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(138, 100, 178, 0.1);
}

th {
    font-weight: 600;
    color: var(--logo-mauve-dark);
    background: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
}

/* Dialog */
#admin-dialog {
    --md-dialog-container-shape: 32px;
}

.fullscreen-dialog {
    max-width: 95vw;
    width: 1000px;
    --md-dialog-container-color: #fbf8fe;
    --md-dialog-container-shape: 32px;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    text-transform: uppercase;
}

.status-badge.status-actif {
    background: rgba(178, 210, 91, 0.2);
    color: #435b00;
    border: 1px solid rgba(178, 210, 91, 0.3);
}

.status-badge.status-passif {
    background: rgba(138, 100, 178, 0.1);
    color: var(--logo-mauve-dark);
    border: 1px solid rgba(138, 100, 178, 0.15);
}

.status-badge.status-ca {
    background: rgba(240, 204, 95, 0.2);
    color: #5c4500;
    border: 1px solid rgba(240, 204, 95, 0.3);
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .double-column {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .benefits-card {
        padding: 32px 24px;
    }
    
    .form-card {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .euros-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .app-bar-content {
        padding: 12px 16px;
    }
    
    .logo-title-group {
        gap: 12px;
    }
    
    .app-logo {
        height: 44px;
    }
    
    .titles h1 {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 11px;
    }
    
    .main-content {
        padding: 24px 16px;
    }
    
    .card {
        padding: 24px 16px;
    }
    
    .benefits-card h2 {
        font-size: 26px;
    }
    
    .benefits-intro {
        margin-bottom: 24px;
    }
    
    .benefits-list {
        gap: 24px;
    }
    
    .form-card h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    #btn-admin {
        height: 36px;
        font-size: 13px;
        padding: 0 16px;
    }
    
    .euros-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .pill-btn {
        font-size: 12px;
        height: 36px;
    }

    .donation-card {
        padding: 0;
        gap: 16px;
    }

    .plants-subcard {
        padding: 0;
    }
}

