/* ==========================================
   PAGE-SPECIFIC STYLES — Cardinal Invest
   ========================================== */

/* ---- HOME PAGE ---- */

.home-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-20) var(--space-6);
    width: 100%;
}

@media (max-width: 768px) {
    .home-section {
        padding: var(--space-12) var(--space-6);
    }
}

.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--text-inverse);
    text-align: center;
}

.section-intro {
    background: var(--bg);
    text-align: center;
    min-height: auto;
    padding: 8rem var(--space-6);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(232, 132, 60, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(245, 166, 35, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    transform: translateY(-4rem);
    /* Ajusté selon la demande */
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero h1 {
    font-size: var(--font-size-5xl);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-4);
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

.hero h1 span {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-10);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: inline-flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    justify-content: center;
}

.hero-cta .btn-primary {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.hero-cta .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-inverse);
}

.hero-cta .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-inverse);
}

/* Floating shapes */
.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: white;
}

.hero-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
    animation: float 12s ease-in-out infinite;
}

.hero-shape:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -40px;
    animation: float 16s ease-in-out infinite reverse;
}

.hero-shape:nth-child(3) {
    width: 120px;
    height: 120px;
    top: 40%;
    left: 10%;
    animation: float 10s ease-in-out infinite 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(5deg);
    }

    66% {
        transform: translateY(10px) rotate(-3deg);
    }
}

/* ---- BOOKING PAGE ---- */

.booking-page {
    padding: var(--space-12) 0;
}

.booking-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.booking-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-3);
}

.booking-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.booking-cta {
    text-align: center;
    margin-bottom: var(--space-8);
}

.booking-cta .btn {
    padding: var(--space-5) var(--space-10);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(232, 132, 60, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(232, 132, 60, 0.5);
    }
}

/* Calendar locked state */
.calendar-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.calendar-wrapper.locked {
    pointer-events: none;
    user-select: none;
}

.calendar-wrapper.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(247, 249, 252, 0.7);
    backdrop-filter: blur(3px);
    z-index: 5;
    border-radius: var(--radius-xl);
}

.calendar-lock-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    text-align: center;
    padding: var(--space-8);
}

.calendar-lock-message .lock-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.calendar-lock-message p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Calendar component */
.calendar-container {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}

.calendar-nav h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.calendar-nav-btns {
    display: flex;
    gap: var(--space-2);
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(5, 1fr);
    min-height: 500px;
}

.mobile-day-selector {
    display: none;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .mobile-day-selector {
        display: flex;
        justify-content: space-between;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .calendar-time-col {
        display: none;
    }

    .calendar-day-col {
        display: none;
        border-right: none;
    }

    .calendar-day-col.active {
        display: block;
    }

    .calendar-cell {
        height: auto;
        min-height: 54px;
        display: flex;
        align-items: center;
        padding: var(--space-2) var(--space-4);
        margin: var(--space-1) var(--space-2);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
    }

    .calendar-cell.unavailable {
        display: none;
        /* Hide unavailable on mobile for cleaner look */
    }

    .calendar-cell.available {
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .calendar-cell.selected {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }

    .mobile-slot-label {
        font-weight: 600;
        font-size: var(--font-size-base);
    }

    .day-dot {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: var(--space-2);
        background: transparent;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all var(--transition-fast);
        min-width: 48px;
    }

    .day-dot.active {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

    .day-dot.today {
        border-color: var(--accent);
        border-width: 2px;
    }

    .day-name {
        font-size: 0.65rem;
        text-transform: uppercase;
        font-weight: 700;
        opacity: 0.8;
    }

    .day-num {
        font-size: 1rem;
        font-weight: 800;
    }
}

.calendar-time-col {
    border-right: 1px solid var(--border-light);
}

.calendar-time-slot {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.calendar-day-col {
    border-right: 1px solid var(--border-light);
}

.calendar-day-col:last-child {
    border-right: none;
}

.calendar-day-header {
    padding: var(--space-3);
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}

.calendar-day-header .day-number {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text);
    margin-top: var(--space-1);
}

.calendar-day-header.today {
    background: var(--primary-50);
}

.calendar-day-header.today .day-number {
    color: var(--primary);
}

.calendar-cell {
    height: 48px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.calendar-cell:hover {
    background: var(--accent-50);
}

.calendar-cell.available {
    cursor: pointer;
}

.calendar-cell.available:hover {
    background: var(--accent-50);
}

.calendar-cell.available:hover::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-size-lg);
    color: var(--accent);
    font-weight: 700;
}

.calendar-cell.unavailable {
    background: var(--bg);
    cursor: default;
}

.calendar-cell.selected {
    background: var(--accent);
    border-radius: var(--radius-sm);
}

.calendar-cell.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 700;
}

.calendar-cell.booked {
    background: var(--primary-50);
    border-left: 3px solid var(--primary);
    cursor: default;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* Color coding by appointment type */
.calendar-cell.booked.type-presentation {
    border-left-color: var(--primary);
    background: var(--primary-50);
}

.calendar-cell.booked.type-presentation span {
    color: var(--primary-dark);
}

.calendar-cell.booked.type-solutions {
    border-left-color: var(--accent);
    background: var(--accent-50);
}

.calendar-cell.booked.type-solutions span {
    color: var(--accent-dark);
}

.calendar-cell.booked.type-suivi {
    border-left-color: var(--success);
    background: var(--success-bg);
}

.calendar-cell.booked.type-suivi span {
    color: var(--success);
}

.calendar-cell.booked.type-telephone {
    border-left-color: var(--secondary);
    background: rgba(107, 123, 141, 0.08);
    /* manual --secondary-50 */
}

.calendar-cell.booked.type-telephone span {
    color: var(--secondary-dark);
}

.calendar-cell.booked[style*="height"] {
    /* Si la case s'étale sur plusieurs créneaux, on adoucit l'arrondi et on met une légère ombre interne */
    border-radius: 0 4px 4px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.calendar-cell.booked span {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding: 6px 8px;
    color: var(--primary-dark);
    line-height: 1.2;
}

.calendar-cell.blocked {
    background: repeating-linear-gradient(45deg,
            var(--bg),
            var(--bg) 4px,
            var(--border-light) 4px,
            var(--border-light) 8px);
    cursor: default;
}

.weekend-message {
    text-align: center;
    padding: var(--space-4) var(--space-6);
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-md);
    margin-top: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.weekend-message a {
    color: var(--accent-dark);
    font-weight: 600;
}

/* Slot selection confirmation */
.slot-confirm {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-6);
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.slot-confirm h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.slot-confirm-details {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
    display: inline-block;
}

.slot-confirm-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

/* ---- CLIENT PAGE ---- */

.client-page {
    padding: var(--space-12) 0;
}

.client-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.client-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.client-header p {
    color: var(--text-secondary);
}

.appointment-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    transition: all var(--transition-base);
}

.appointment-card:hover {
    box-shadow: var(--shadow-md);
}

.appointment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.appointment-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.appointment-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.appointment-info-item .label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.appointment-info-item .value {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
}

.appointment-actions {
    display: flex;
    gap: var(--space-3);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
}

/* ---- ADMIN PAGE ---- */

.admin-page {
    padding: var(--space-8) 0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.admin-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

.admin-pending-card {
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.admin-pending-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-pending-contact,
.admin-pending-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.admin-pending-contact {
    color: var(--text-secondary);
}

.admin-comments-box {
    background-color: var(--bg);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
}

.admin-actions-group {
    display: flex;
    gap: 0.75rem;
    align-self: center;
}

.admin-stats-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .admin-stats-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .admin-pending-info {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions-group {
        justify-content: stretch;
    }

    .admin-actions-group .btn {
        flex: 1;
    }

    .table thead {
        display: none;
        /* Hide header on very small screens */
    }

    .table td {
        display: block;
        padding: var(--space-2) var(--space-4);
        border-bottom: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: var(--font-size-xs);
        color: var(--text-muted);
        display: block;
        margin-bottom: 2px;
        text-transform: uppercase;
    }

    .table tr {
        display: block;
        border-bottom: 1px solid var(--border-light);
        padding: var(--space-4) 0;
    }
}

.settings-container {
    display: grid;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

.settings-card {
    padding: 2rem;
    border-radius: 1.5rem;
}

@media (max-width: 600px) {
    .settings-container {
        gap: 1.5rem;
        padding-bottom: 2rem;
    }

    .settings-card {
        padding: 1.25rem;
        border-radius: 1rem;
    }
}

.login-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.login-card .logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-6);
}

.login-card h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.login-card .form-group {
    text-align: left;
}

/* Admin calendar for blocking */
.admin-calendar .calendar-cell:hover {
    background: var(--danger-bg);
}

.admin-calendar .calendar-cell:hover::after {
    content: '✕';
    color: var(--danger);
}

/* Stats charts placeholder */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.chart-container h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--text);
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.chart-bar-label {
    min-width: 160px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: right;
}

.chart-bar {
    flex: 1;
    height: 32px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    padding-left: var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
    min-width: fit-content;
}

.chart-bar-fill.primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.chart-bar-fill.orange {
    background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.chart-bar-fill.secondary {
    background: linear-gradient(90deg, var(--secondary-dark), var(--secondary));
}

.chart-bar-fill.green {
    background: linear-gradient(90deg, #2F8F5B, var(--success));
}

.chart-bar-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
    min-width: 40px;
}

/* Period selector */
.period-selector {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.period-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.period-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

/* Donut chart */
.donut-container {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex-wrap: wrap;
    justify-content: center;
}

.donut-chart {
    position: relative;
    width: 180px;
    height: 180px;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center .value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.donut-center .label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .hero {
        padding: var(--space-12) 0;
    }

    .hero h1 {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .booking-page,
    .client-page,
    .admin-page {
        padding: var(--space-6) 0;
    }

    .calendar-grid {
        grid-template-columns: 60px repeat(5, 1fr);
    }

    .calendar-time-slot {
        font-size: 10px;
    }

    .appointment-info-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}