@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap");

:root {
    --bg: #050505;
    --panel: #171717;
    --panel-solid: #171717;
    --surface: #202020;
    --surface-2: #2a2a2a;
    --text: #ffffff;
    --text-soft: #e5e5e5;
    --muted: #c7c7c7;
    --muted-2: #8f8f8f;
    --line: #343434;
    --line-soft: #262626;
    --primary: #c9962c;
    --primary-strong: #e0ad3f;
    --primary-dark: #8a6418;
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, 0.16);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.16);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
    --radius-lg: 18px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 22px;
    background: var(--bg);
    color: var(--text);
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input,
select {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* Main Container */
.container {
    width: min(520px, 100%);
    margin: 28px auto;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow-md);
    text-align: center;
}

    .container h2 {
        margin: 0 0 8px;
        color: var(--text);
        font-size: 28px;
        line-height: 1;
        font-weight: 900;
        text-align: center;
        letter-spacing: -0.05em;
    }

.brand-header {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

    .brand-header h2 {
        margin: 2px 0 0;
    }

.brand-logo-img {
    width: min(250px, 78%);
    height: auto;
    display: block;
    margin: 0 auto 4px;
    /* If using the original JPEG with black background, screen blend makes the black background invisible! */
    mix-blend-mode: lighten;
}


.brand-monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border: 1px solid rgba(201, 150, 44, 0.45);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(201, 150, 44, 0.2), rgba(201, 150, 44, 0.05));
    color: var(--primary-strong);
    font-size: 18px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.04em;
}

.brand-tagline {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.9;
}

.container > p,
.muted {
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.55;
}

#checking-session {
    padding: 18px 0;
}

/* Login & Inputs */
#login-box {
    display: none;
    padding-top: 6px;
}

    #login-box p {
        margin: 0 0 16px;
        color: var(--muted);
        font-size: 13px;
    }

input,
select.input {
    width: 100%;
    min-height: 44px;
    margin: 8px 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    outline: none;
    background: #202020;
    color: #ffffff;
    font-size: 13px;
    font-weight: 550;
    text-align: center;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

    input:hover,
    select.input:hover {
        background: #262626;
        border-color: var(--primary);
    }

    input:focus,
    select.input:focus {
        background: #262626;
        border-color: var(--primary-strong);
        box-shadow: 0 0 0 4px rgba(201, 150, 44, 0.18);
    }

    input::placeholder {
        color: var(--muted-2);
        text-align: center;
    }

button {
    min-height: 42px;
    padding: 10px 14px;
    margin: 10px 0 0;
    border: 1px solid rgba(201, 150, 44, 0.45);
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--primary);
    color: #050505;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

    button:hover {
        transform: translateY(-1px);
        background: var(--primary-strong);
    }

    button:active {
        transform: translateY(0);
    }

    /* Deconectare Button - Placed early so it always applies */
    button.btn-red,
    .btn-red {
        width: 100%;
        margin-top: 24px;
        background: rgba(239, 68, 68, 0.10);
        color: #ff5a5a;
        border: 1px solid rgba(239, 68, 68, 0.45);
        box-shadow: none;
        font-weight: 700;
    }

        button.btn-red:hover,
        .btn-red:hover {
            background: rgba(239, 68, 68, 0.20);
            border-color: var(--red);
            color: #ff7b7b;
        }

.btn-gray {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--line-soft);
    box-shadow: none;
}

    .btn-gray:hover {
        background: #383838;
    }

#login-error {
    margin-top: 9px;
    color: #f87171;
    font-size: 13px;
    font-weight: 800;
}

/* Check-in Popup Overlay */
#checkin-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.popup-box {
    width: min(340px, 100%);
    padding: 25px;
    border: 1px solid rgba(201, 150, 44, 0.5);
    border-radius: 24px;
    background: linear-gradient(145deg, #1f1709 0%, #141414 100%);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.popup-emoji {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--green-soft);
    color: #4ade80;
    font-size: 28px;
    font-weight: 800;
}

.popup-box h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
}

#pop-credits-text {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
}

/* Portal Shell */
#result {
    display: none;
    text-align: left;
}

.welcome {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.performance-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.student-performance-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 6px 10px;
    border: 1px solid rgba(201, 150, 44, 0.45);
    border-radius: 999px;
    background: rgba(201, 150, 44, 0.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

/* Tabs */
.tab-bar {
    margin: 0 0 16px;
    padding: 5px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: var(--surface);
}

.portal-tab-btn {
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 8px 5px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--muted-2);
    box-shadow: none;
    font-size: 12px;
    font-weight: 800;
}

    .portal-tab-btn:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text);
    }

    .portal-tab-btn.active {
        background: linear-gradient(135deg, var(--primary-strong), var(--primary-dark));
        color: #050505;
        border-color: rgba(201, 150, 44, 0.45);
        box-shadow: 0 8px 22px rgba(201, 150, 44, 0.24);
    }

#psec-credits,
#psec-files,
#psec-bookings {
    display: none;
}

/* Today Reminder */
.today-reminder {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid rgba(201, 150, 44, 0.5);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(201, 150, 44, 0.18) 0%, #171717 65%);
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.today-reminder-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #050505;
    font-size: 18px;
    font-weight: 900;
}

.today-reminder-label {
    margin-bottom: 2px;
    color: var(--primary-strong);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.today-reminder h3 {
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 800;
}

.today-reminder p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.today-reminder-action {
    min-height: 34px;
    margin: 0;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 12px;
}

/* Install App Button */
.install-card {
    margin-bottom: 14px;
    text-align: center;
}

.install-btn {
    width: 100%;
    min-height: 40px;
    margin: 0;
    background: transparent;
    color: var(--primary);
    border-color: rgba(201, 150, 44, 0.55);
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

    .install-btn:hover {
        background: rgba(201, 150, 44, 0.12);
        border-color: var(--primary);
    }

.install-hint {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* Cards */
.card {
    margin: 11px 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    text-align: left;
}

    .card.centered {
        text-align: center;
    }

    .card h3,
    .card h4 {
        margin: 0 0 12px;
        color: var(--text);
        font-weight: 800;
    }

    .card h4 {
        font-size: 17px;
        text-align: center;
    }

.pass-balance-card {
    padding: 22px 18px;
    border-color: rgba(201, 150, 44, 0.45);
    background: linear-gradient(135deg, #1f1608 0%, #151515 48%, #0d0d0d 100%);
}

.balance-label {
    margin-bottom: 10px;
    color: #f1f1f1;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    line-height: 1;
}

    .balance-amount .amount-value {
        color: var(--primary);
        font-size: 26px;
        font-weight: 950;
    }

    .balance-amount .amount-currency {
        color: var(--text);
        font-size: 16px;
        font-weight: 900;
    }

    .balance-amount.negative .amount-value,
    .balance-amount.negative .amount-currency {
        color: var(--red);
    }

.balance-sub {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

/* QR Card */
.qr-pass-card {
    padding: 22px 18px 20px;
    border-color: var(--line);
    background: linear-gradient(180deg, #171717 0%, #101010 100%);
}

.qr-card-label {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.qr-card-subtitle {
    margin-bottom: 16px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}

.qr-pass-card img {
    width: 176px;
    max-width: 78%;
    display: block;
    margin: 0 auto 14px;
    padding: 10px;
    border: 2px solid #c9962c;
    border-radius: 22px;
    background: #e2b857;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    transition: transform 0.18s ease;
}


    .qr-pass-card img:hover {
        transform: scale(1.04);
    }

.qr-id {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

    .qr-id b {
        color: var(--text);
    }

.qr-expand-card {
    width: min(430px, 100%);
    text-align: center;
}

#qr-expanded-img {
    width: min(300px, 80vw);
    max-width: 100%;
    display: block;
    margin: 8px auto 0;
    padding: 12px;
    border: 2px solid #c9962c;
    border-radius: 22px;
    background: #e2b857;
}


/* Performance Tab */
.performance-index-card {
    padding: 22px 18px;
    margin-bottom: 14px;
    text-align: center;
    border-color: rgba(201, 150, 44, 0.45);
    background: linear-gradient(135deg, #1f1608 0%, #151515 48%, #0d0d0d 100%);
}

.performance-index-label {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.performance-index-value {
    color: var(--primary);
    font-size: 42px;
    font-weight: 950;
    line-height: 1;
}

    .performance-index-value span {
        margin-left: 4px;
        color: var(--text);
        font-size: 18px;
        font-weight: 900;
    }

.performance-drill-card {
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #171717 0%, #101010 100%);
}

.performance-drill-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.performance-drill-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.performance-drill-result {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.performance-drill-score {
    min-width: 64px;
    color: var(--primary);
    font-size: 22px;
    font-weight: 950;
    text-align: right;
}

    .performance-drill-score span {
        color: var(--text);
        font-size: 12px;
    }

.performance-score-bar {
    height: 7px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #262626;
}

    .performance-score-bar div {
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--primary-dark), var(--primary-strong));
    }

/* Istoric Plăți */
.credit-card {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 12px 13px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--green);
    border-radius: 15px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .credit-card b {
        display: block;
        color: #4ade80;
        font-size: 15px;
        font-weight: 800;
    }

.credit-card-negative {
    border-left-color: var(--primary);
}

    .credit-card-negative b {
        color: var(--primary-strong);
    }

.credit-card small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.credit-card span {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

/* Files */
.file-card {
    margin-bottom: 10px;
    padding: 13px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--primary);
    border-radius: 15px;
    background: var(--surface);
    text-align: center;
}

    .file-card b {
        display: block;
        color: var(--text);
        font-size: 13px;
        font-weight: 800;
    }

    .file-card small {
        display: block;
        margin: 4px 0 8px;
        color: var(--muted);
        font-size: 11px;
    }

    .file-card a {
        padding: 7px 12px;
        border: 1px solid rgba(201, 150, 44, 0.45);
        border-radius: 10px;
        display: inline-flex;
        background: rgba(201, 150, 44, 0.15);
        color: var(--primary-strong);
        text-decoration: none;
        font-size: 12px;
        font-weight: 800;
    }

/* Sesiuni (Bookings) */
.booking-card {
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--primary);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    text-align: center;
}

.booking-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 3px;
}

.booking-datetime {
    display: block;
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 600;
}

.booking-meta {
    color: var(--muted);
    font-size: 12.5px;
}

    .booking-meta b {
        color: var(--text);
        font-weight: 800;
    }

.status-attended,
.status-walkin,
.status-booked,
.status-noshow {
    min-height: 25px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 800;
}

.status-attended,
.status-walkin {
    background: var(--green-soft);
    color: #4ade80;
}

.status-booked {
    background: rgba(201, 150, 44, 0.16);
    color: var(--primary-strong);
}

.status-noshow {
    background: var(--red-soft);
    color: #f87171;
}

/* Open Classes */
.join-class-section h3 {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    margin: 20px 0 12px;
}

.open-class-card {
    margin: 0 0 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    text-align: left;
}

    .open-class-card .header h4 {
        margin: 0 0 8px;
        font-size: 17px;
        font-weight: 800;
    }

.free-badge {
    background: var(--green-soft);
    color: #4ade80;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.open-class-card .details {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.open-class-card .spots-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--line);
    border-radius: 99px;
    overflow: hidden;
}

    .open-class-card .spots-progress-bar .fill {
        height: 100%;
        background-color: var(--green);
        border-radius: 99px;
    }

.open-class-card .spots-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin: 5px 0 12px;
}

.open-class-card .join-btn {
    margin: 0;
    width: 100%;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
}

.modal-card {
    width: min(460px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    text-align: left;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

    .modal-header h2 {
        margin: 0;
        font-size: 24px;
        font-weight: 800;
        text-align: left;
    }

    .modal-header p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 13px;
    }

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line-soft);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    padding: 0;
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

    .form-grid.three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
    }

.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .field-group .input {
        margin: 0;
    }

.field-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

input[type="date"] {
    color-scheme: dark;
    font-size: 12px;
    padding: 11px 8px;
}

.input-with-unit {
    position: relative;
}

    .input-with-unit .unit-input {
        padding-right: 38px;
    }

    .input-with-unit span {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        pointer-events: none;
    }


@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .container {
        margin: 16px auto;
        padding: 19px;
    }

    .credit-card {
        flex-direction: column;
        text-align: center;
    }

        .credit-card span {
            text-align: center;
        }
}
