:root {
    --bg-top: #fffaf2;
    --bg-bottom: #e8f2ff;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(18, 52, 108, 0.12);
    --text: #0f2855;
    --muted: #6b7a99;
    --primary: #3588ff;
    --primary-dark: #2567c7;
    --danger: #cc3b3b;
    --success: #1d8f59;
    --shadow: 0 24px 60px rgba(41, 76, 133, 0.16);
    --radius-xl: 28px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(53, 136, 255, 0.14), transparent 30%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-card,
.payment-card,
.redirect-card,
.status-card {
    width: min(100%, 980px);
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 40px;
    backdrop-filter: blur(8px);
}

.auth-card {
    width: min(100%, 760px);
    text-align: center;
}

.payment-card {
    width: min(100%, 900px);
}

.brand-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.brand-logo {
    display: block;
    width: min(100%, 360px);
    max-height: 120px;
    object-fit: contain;
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.intro-copy,
.redirect-card p {
    margin: 0 auto 28px;
    color: var(--muted);
    max-width: 560px;
    font-size: 1rem;
}

.portal-form,
.payment-form {
    display: grid;
    gap: 18px;
}

.portal-form {
    margin-top: 28px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

label span {
    color: #ef4a4a;
}

input,
select {
    width: 100%;
    border: 1px solid rgba(15, 40, 85, 0.12);
    background: rgba(250, 252, 255, 0.95);
    color: var(--text);
    border-radius: 16px;
    padding: 18px 20px;
    font-size: 1rem;
    outline: none;
}

select {
    appearance: none;
}

input:focus,
select:focus {
    border-color: rgba(53, 136, 255, 0.65);
    box-shadow: 0 0 0 4px rgba(53, 136, 255, 0.15);
}

input[readonly] {
    color: #425e91;
}

button,
.secondary-link {
    border: 0;
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

button {
    justify-self: center;
    background: linear-gradient(135deg, var(--primary), #5aa2ff);
    color: #fff;
    min-width: 180px;
}

button:hover,
.secondary-link:hover {
    transform: translateY(-1px);
}

.secondary-link {
    background: rgba(15, 40, 85, 0.07);
    color: var(--text);
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert-error {
    background: rgba(204, 59, 59, 0.1);
    color: var(--danger);
}

.alert-success {
    background: rgba(29, 143, 89, 0.1);
    color: var(--success);
}

.step-indicator {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.step {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 40, 85, 0.08);
    color: var(--muted);
    font-weight: 700;
}

.step.active {
    background: rgba(53, 136, 255, 0.12);
    color: var(--primary-dark);
}

.student-summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(15, 40, 85, 0.08);
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
    color: var(--muted);
}

.summary-grid,
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 16px;
}

.summary-grid div,
.status-grid div {
    background: rgba(15, 40, 85, 0.04);
    border-radius: 16px;
    padding: 16px;
}

.summary-grid span,
.status-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field-row.single {
    grid-template-columns: 1fr;
}

.payment-header {
    text-align: center;
    margin-bottom: 34px;
}

.payment-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.payment-form-stacked {
    gap: 28px;
}

.payment-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.payment-row label {
    margin-bottom: 0;
    font-size: 1.05rem;
    text-align: left;
}

.payment-input-wrap {
    position: relative;
}

.payment-input-wrap input,
.payment-input-wrap select {
    min-height: 72px;
    padding-inline: 30px;
    border-radius: 18px;
    font-size: 1.05rem;
    background: #fbfbfd;
}

.payment-input-wrap input::placeholder {
    color: #98a7c8;
}

.select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 28px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #7888ad;
    border-bottom: 2px solid #7888ad;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 12px;
}

.action-bar.center {
    justify-content: center;
}

.payment-actions {
    justify-content: center;
    margin-top: 4px;
}

.payment-actions button {
    background: linear-gradient(135deg, #45c987, #58d48f);
    min-width: 134px;
}

.redirect-card,
.status-card {
    width: min(100%, 720px);
    text-align: center;
}

.admin-login-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.admin-auth-card {
    width: min(100%, 640px);
}

.admin-page-shell {
    padding: 32px;
    align-items: start;
}

.admin-card {
    width: min(100%, 1180px);
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 36px;
    backdrop-filter: blur(8px);
}

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

.admin-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-tile {
    background: rgba(15, 40, 85, 0.04);
    border: 1px solid rgba(15, 40, 85, 0.08);
    border-radius: 20px;
    padding: 22px;
}

.stat-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(41, 76, 133, 0.12);
    border-color: rgba(53, 136, 255, 0.22);
}

.stat-link strong {
    display: block;
}

.stat-tile span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.stat-tile strong {
    font-size: 1.8rem;
}

.admin-section {
    margin-top: 26px;
}

.admin-section-head {
    margin-bottom: 14px;
}

.admin-section-head h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
}

.admin-section-head p {
    margin: 0;
    color: var(--muted);
}

.table-shell {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 40, 85, 0.08);
    border-radius: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(15, 40, 85, 0.08);
}

.admin-table th {
    background: rgba(15, 40, 85, 0.04);
    font-size: 0.92rem;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.upload-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 40, 85, 0.08);
    border-radius: 20px;
    padding: 22px;
}

.upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.upload-help {
    background: rgba(15, 40, 85, 0.04);
    border-radius: 16px;
    padding: 16px 18px;
    color: var(--muted);
}

.upload-help p {
    margin: 0 0 10px;
}

.upload-help p:last-child {
    margin-bottom: 0;
}

.upload-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-actions .secondary-link {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .auth-card,
    .payment-card,
    .redirect-card,
    .status-card {
        padding: 24px;
    }

    .field-row,
    .summary-grid,
    .status-grid,
    .student-summary {
        grid-template-columns: 1fr;
        display: grid;
    }

    .student-summary {
        align-items: start;
    }

    .payment-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .admin-header,
    .admin-stats {
        grid-template-columns: 1fr;
        display: grid;
    }

    .admin-card {
        padding: 24px;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    button,
    .secondary-link {
        width: 100%;
    }
}

.receipt-card {
    width: min(100%, 920px);
    text-align: left;
}

.receipt-brand-mark {
    margin-bottom: 10px;
}

.receipt-status-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 28px 0;
    padding: 18px;
    border-radius: 18px;
    background: rgba(53, 136, 255, 0.08);
}

.receipt-status-label {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.receipt-status-value {
    font-size: 2rem;
    color: var(--primary-dark);
}

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .receipt-grid,
    .receipt-contact-grid {
        grid-template-columns: 1fr;
    }
}

.receipt-grid div {
    background: rgba(15, 40, 85, 0.04);
    border-radius: 16px;
    padding: 16px;
}

.receipt-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.receipt-message {
    grid-column: 1 / -1;
}

.receipt-actions {
    justify-content: center;
}

@media print {
    body {
        background: #fff;
    }

    .page-shell {
        padding: 0;
    }

    .receipt-card {
        box-shadow: none;
        border: 0;
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .receipt-actions {
        display: none;
    }
}

.receipt-contact-card {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid rgba(15, 40, 85, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
}

.receipt-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 34px;
}

.receipt-contact-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.receipt-contact-icon {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #c91042, #dc1e57);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(201, 16, 66, 0.22);
    flex-shrink: 0;
}

.receipt-contact-title {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #394c63;
}

.receipt-contact-item p {
    margin: 0;
    color: #6b6f78;
    font-size: 1rem;
    line-height: 1.45;
}
