@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: local('Montserrat'), url('/font/montserrat-regular.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    src: local('Montserrat'), url('/font/montserrat-600.woff2') format('woff2');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Montserrat', sans-serif;
    font-size: 62.5%;
}

body {
    background-color: #f5f7f5;
    color: #1a1a1a;
    font-size: 1.6rem;
    line-height: 1.6;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ── Auth pages ── */
.auth-page {
    background: linear-gradient(135deg, #3a3a3a 0%, #5a5a5a 50%, #3a3a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: #ffffff;
    border-radius: 1.6rem;
    padding: 4rem 3.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.auth-logo img {
    border-radius: 50%;
    margin-bottom: 1.6rem;
}

.auth-card h1 {
    color: #1B5E20;
    font-size: 2.4rem;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    color: #666;
    font-size: 1.4rem;
    margin-bottom: 2.4rem;
}

.form-group {
    text-align: left;
    margin-bottom: 1.6rem;
}

.form-group label {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.4rem;
}

.form-group .optional {
    font-weight: 400;
    color: #999;
}

.form-group input {
    width: 100%;
    padding: 1.2rem 1.4rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-row {
    display: flex;
    gap: 1.2rem;
}

.form-row .form-group {
    flex: 1;
}

.btn-primary {
    width: 100%;
    padding: 1.4rem 2.4rem;
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: #fff;
    border: none;
    border-radius: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    padding: 1.2rem 2.4rem;
    background: transparent;
    color: #2E7D32;
    border: 2px solid #2E7D32;
    border-radius: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #F1F8F4;
}

.btn-outline-sm {
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.error-msg {
    background: #FFEBEE;
    color: #C62828;
    padding: 1.2rem;
    border-radius: 0.8rem;
    font-size: 1.3rem;
    margin-bottom: 1.6rem;
    text-align: left;
}

.auth-footer {
    margin-top: 2.4rem;
    font-size: 1.3rem;
}

.auth-footer a {
    color: #2E7D32;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 1.2rem;
    color: #888 !important;
    font-weight: 400 !important;
}

.change-pw-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 1.2rem;
    color: #666 !important;
    font-weight: 400 !important;
    text-decoration: none;
}

.change-pw-link:hover {
    color: #2E7D32 !important;
}

.spinner {
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Dashboard ── */
.dashboard-header {
    background: linear-gradient(135deg, #3a3a3a 0%, #5a5a5a 50%, #3a3a3a 100%);
    color: #fff;
    padding: 1.2rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.6rem;
}

.header-logo img {
    border-radius: 50%;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.4rem;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.section-card {
    background: #fff;
    border-radius: 1.2rem;
    padding: 2.4rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.section-header h2 {
    font-size: 2rem;
    color: #1B5E20;
    margin-bottom: 1.6rem;
}

/* Bookings list */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.booking-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6rem;
    background: #F1F8F4;
    border-radius: 0.8rem;
    border-left: 4px solid #2E7D32;
    transition: transform 0.15s;
}

.booking-card:hover {
    transform: translateX(4px);
}

.booking-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.booking-date {
    font-weight: 600;
    font-size: 1.5rem;
    color: #1B5E20;
}

.booking-time {
    font-size: 1.3rem;
    color: #555;
}

.booking-type {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: #2E7D32;
    color: #fff;
    border-radius: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
}

.booking-cancel {
    padding: 0.8rem 1.6rem;
    background: transparent;
    color: #C62828;
    border: 1px solid #C62828;
    border-radius: 0.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.booking-cancel:hover {
    background: #FFEBEE;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 3.2rem 1.6rem;
}

.empty-state p:first-child {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.loading-state {
    text-align: center;
    color: #888;
    padding: 2rem;
}

/* ── Calendar ── */
.calendar-container {
    margin-bottom: 2rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.6rem;
}

.calendar-nav h3 {
    font-size: 1.8rem;
    color: #1B5E20;
    min-width: 200px;
    text-align: center;
    text-transform: capitalize;
}

.cal-nav-btn {
    width: 4rem;
    height: 4rem;
    background: #F1F8F4;
    border: 2px solid #2E7D32;
    border-radius: 50%;
    color: #2E7D32;
    font-size: 2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: #2E7D32;
    color: #fff;
}

.calendar-grid,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-legend {
    display: flex;
    gap: 1.6rem;
    margin-top: 1.2rem;
    padding: 0.8rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    color: #666;
}

.legend-dot {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 0.3rem;
}

.legend-dot.available {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 2px solid #66BB6A;
}

.legend-dot.today-dot {
    background: #fff;
    border: 2px solid #2E7D32;
}

.cal-header {
    padding: 1rem 0.4rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: #888;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    cursor: default;
    transition: all 0.15s;
    position: relative;
    min-height: 7rem;
    padding: 0.4rem 0.2rem;
    gap: 0.2rem;
}

.cal-day .day-num {
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 0.4rem;
}

.cal-day.other-month {
    color: #ccc;
}

.cal-day.past {
    color: #bbb;
    background: #fafafa;
}

.cal-day.today {
    outline: 2px solid #2E7D32;
    outline-offset: -2px;
}

.cal-day.today .day-num {
    font-weight: 700;
    color: #2E7D32;
}

.cal-day.has-slots {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    cursor: pointer;
    border: 2px solid #66BB6A;
}

.cal-day.has-slots:hover {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.cal-day.has-slots .day-num {
    font-weight: 700;
    color: #1B5E20;
}

.cal-day .day-badge {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #2E7D32;
    padding: 0.1rem 0.5rem;
    border-radius: 0.4rem;
    line-height: 1.3;
}

.day-activities {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    width: 100%;
    padding: 0 4px 4px 4px;
}

.cal-activity-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #333;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 4px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
}

.cal-activity-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.cal-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cal-day .day-places {
    font-size: 0.9rem;
    color: #2E7D32;
    font-weight: 600;
    line-height: 1;
}

.cal-day.selected {
    background: #2E7D32 !important;
    color: #fff;
    border-color: #1B5E20 !important;
}

.cal-day.selected .day-num,
.cal-day.selected .day-places {
    color: #fff;
}

.cal-day.selected .day-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* Slot panel */
.slots-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #F1F8F4;
}

.slots-panel h3 {
    font-size: 1.6rem;
    color: #1B5E20;
    margin-bottom: 1.2rem;
}

.slots-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.6rem;
    background: #F9FBF9;
    border: 2px solid #E8F5E9;
    border-radius: 0.8rem;
    transition: border-color 0.2s;
}

.slot-card:hover {
    border-color: #2E7D32;
}

.slot-card.slot-mine {
    background: #E3F2FD;
    border-color: #1565C0;
}

.slot-card.slot-full {
    background: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.7;
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.slot-time {
    font-weight: 600;
    font-size: 1.5rem;
}

.slot-meta {
    font-size: 1.2rem;
    color: #666;
}

.slot-places {
    font-size: 1.2rem;
    color: #2E7D32;
    font-weight: 600;
}

.btn-book {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: #fff;
    border: none;
    border-radius: 0.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-book:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.3);
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 1.6rem;
    padding: 3.2rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.6rem;
    background: none;
    border: none;
    font-size: 2.4rem;
    color: #999;
    cursor: pointer;
}

.modal-close:hover {
    color: #333;
}

.modal-content h3 {
    font-size: 2rem;
    color: #1B5E20;
    margin-bottom: 1.6rem;
}

.modal-details {
    background: #F1F8F4;
    padding: 1.6rem;
    border-radius: 0.8rem;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    line-height: 2.2;
}

.modal-actions {
    display: flex;
    gap: 1.2rem;
    justify-content: flex-end;
}

.modal-actions .btn-primary {
    width: auto;
    padding: 1.2rem 3.2rem;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1B5E20;
    color: #fff;
    padding: 1.2rem 2.4rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.3s ease;
    z-index: 2000;
}

.toast.error {
    background: #C62828;
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .auth-card {
        padding: 3.2rem 2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .section-card {
        padding: 1.6rem;
    }

    .booking-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }

    .booking-cancel {
        align-self: flex-end;
    }

    .slot-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-book {
        width: 100%;
    }

    .cal-day {
        min-height: 5rem;
        font-size: 1.2rem;
    }

    .cal-day .day-badge {
        font-size: 0.8rem;
        padding: 0 0.4rem;
    }

    .cal-day .day-places {
        display: none;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-outline {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .header-user span {
        display: none;
    }
}

/* Credits Banner */
.credits-banner {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.credits-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.credits-icon {
    font-size: 1.4rem;
}

.credits-bar {
    height: 8px;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
}

.credits-progress {
    height: 100%;
    background: #27ae60;
    transition: width 0.5s ease;
}

/* Documents List */
.doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, background 0.2s;
    margin-bottom: 0.8rem;
    border: 1px solid #e9ecef;
}

.doc-card:last-child {
    margin-bottom: 0;
}

.doc-card:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.doc-icon {
    font-size: 1.6rem;
    background: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.doc-content {
    flex: 1;
}

.doc-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #2c3e50;
}

.doc-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.doc-date {
    font-size: 0.8rem;
    color: #95a5a6;
}

.doc-arrow {
    font-size: 1.5rem;
    color: #cbd5e0;
    font-weight: 300;
}

.doc-card:hover .doc-arrow {
    color: #34495e;
}

/* Disabled slots (Restricted access) */
.slot-card.disabled-slot {
    opacity: 0.6;
    background-color: #f1f1f1;
    border-left: 4px solid #95a5a6;
    cursor: not-allowed;
}

.btn-disabled {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: not-allowed;
}

.slot-lock {
    display: block;
    font-size: 0.8rem;
    color: #c0392b;
    font-weight: bold;
    margin-top: 0.2rem;
}

/* ── Sessions Counter ── */
.credits-counter {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-radius: 16px;
    padding: 28px 24px 20px;
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(15, 52, 96, 0.3);
}

.credits-counter-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.credits-counter-number {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    color: #2ecc71;
    text-shadow: 0 2px 12px rgba(46, 204, 113, 0.3);
}

.credits-counter-label {
    font-size: 16px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.credits-counter .credits-bar {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.credits-counter .credits-progress {
    height: 100%;
    border-radius: 8px;
    background-color: #2ecc71;
    transition: width 0.8s ease-out;
}

.credits-detail {
    font-size: 13px;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .credits-counter {
        padding: 20px 16px 16px;
    }

    .credits-counter-number {
        font-size: 44px;
    }

    .credits-counter-label {
        font-size: 14px;
    }
}