:root {
    --brand: #0d6efd;
    --brand-light: #f0f7ff;
    --brand-dark: #0a58ca;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-focus: var(--brand);
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fca5a5;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 20%, rgba(15, 23, 42, 0.95) 0%, #090d16 100%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    padding: 24px 16px 48px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Centered Responsive Container */
.page-wrapper {
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
}

.container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 36px 36px;
    border-top: 4px solid var(--brand);
    width: 100%;
}

/* Header & Brand - Always Centered */
.brand-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 24px;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.brand-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.brand-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 10px 22px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    margin: 0 auto 6px auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo {
    max-height: 85px;
    max-width: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    border-radius: 6px;
    flex-shrink: 0;
    margin: 0 auto;
    display: block;
}

.form-title, .brand-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.25;
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    text-align: center;
}

.form-description, .brand-sub {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .brand-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
        padding-bottom: 16px;
        margin-bottom: 18px;
    }
    .brand-info {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
        width: 100%;
    }
    .brand-logo-wrapper {
        padding: 8px 16px;
        border-radius: 10px;
        margin-bottom: 4px;
    }
    .brand-logo {
        max-height: 65px;
        max-width: 220px;
        margin: 0 auto;
    }
    .form-title, .brand-name {
        font-size: 1.38rem;
        line-height: 1.3;
        text-align: center;
    }
    .form-description, .brand-sub {
        font-size: 0.92rem;
        text-align: center;
    }
}

/* Notices and Alerts */
.notice-box {
    display: flex;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    color: #92400e;
    font-size: 0.92rem;
    line-height: 1.45;
}

.notice-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
}

.alert-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

/* Student Search Box */
.student-search-card {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.student-search-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-search-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
}

.student-search-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s;
}

.student-search-item:hover {
    background: #f8fafc;
}

/* Form Cards & Fieldsets */
.form-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 24px 24px;
    margin-bottom: 24px;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

.card-heading {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e293b;
    padding: 0 6px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    width: 100%;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.col-span-2 {
    grid-column: span 2;
}

.field-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.req-star {
    color: #ef4444;
    font-weight: 700;
    font-size: 1rem;
    margin-left: 3px;
    line-height: 1;
}

/* Inputs & Form Controls */
.form-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 1rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px rgba(13, 110, 253, 0.18);
}

.form-control:disabled, .form-control[readonly] {
    background-color: #f8fafc;
    color: #475569;
    cursor: default;
    border-color: #e2e8f0;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* Live Validation States */
.form-control.is-invalid {
    border-color: var(--danger) !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.form-control.is-valid {
    border-color: #10b981;
}

.field-error-msg {
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

.field-error-msg::before {
    content: "⚠";
    font-size: 0.85rem;
}

/* Bulletproof Visible Checkbox */
input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    accent-color: var(--brand) !important;
    position: static !important;
}

.checkbox-box {
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-box:hover {
    background: #f1f5f9;
    border-color: var(--brand);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.checkbox-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.45;
    cursor: pointer;
}

/* Form Actions / Submit Button */
.form-actions {
    margin-top: 32px;
    text-align: right;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--brand);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-submit:hover {
    background-color: var(--brand-dark);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.btn-submit:active {
    transform: translateY(1px);
}

/* Response Page */
.response {
    text-align: center;
    padding: 40px 24px;
}

.status {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    font-weight: 500;
}

.status-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.status-failed { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.status-pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

dl {
    max-width: 480px;
    margin: 24px auto;
    text-align: left;
    background: var(--bg-page);
    padding: 18px 22px;
    border-radius: var(--radius-sm);
}

dt { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }
dd { font-weight: 700; color: var(--text-main); font-size: 1.05rem; word-break: break-all; margin-bottom: 8px; }

.button {
    display: inline-block;
    background: var(--brand);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    margin-top: 16px;
}

/* Helpdesk & Footer Details */
.helpdesk-card {
    margin-top: 28px;
    font-size: 0.88rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: center;
    line-height: 1.6;
}

.helpdesk-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

/* Clean Global Footer */
.page-footer, .app-global-footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.footer-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-client-copy {
    font-size: 0.88rem;
    color: #475569;
    font-weight: 500;
}

.footer-client-copy strong {
    color: #0f172a;
    font-weight: 700;
}

.footer-dev-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: #64748b;
}

.dev-label {
    color: #64748b;
    font-weight: 500;
}

.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0284c7;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease;
}

.dev-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.dev-arrow {
    transition: transform 0.15s ease;
}

.dev-link:hover .dev-arrow {
    transform: translate(1px, -1px);
}

@media (max-width: 680px) {
    .footer-main-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        gap: 8px;
    }
    .footer-client-copy {
        text-align: center;
    }
    .footer-dev-credit {
        justify-content: center;
        text-align: center;
    }
}

/* Bank Search Styles */
.bank-selector-container {
    width: 100%;
    position: relative;
}

.bank-search-box {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.bank-search-input {
    width: 100%;
    height: 42px;
    padding: 8px 36px 8px 12px;
    font-size: 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s ease;
}

.bank-search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.clear-bank-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    display: none;
}

.clear-bank-btn:hover {
    color: #ef4444;
}

.bank-search-count {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 600;
    margin-top: 4px;
    display: none;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 768px) {
    body { padding: 16px 10px; overflow-x: hidden; }
    .page-wrapper { width: 100%; max-width: 100%; overflow-x: hidden; }
    .container { padding: 24px 18px; border-radius: var(--radius-md); max-width: 100%; box-sizing: border-box; }
    .brand-header { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
    .secure-badge { align-self: center; }
}

@media (max-width: 640px) {
    body { padding: 10px 4px; overflow-x: hidden; }
    .page-wrapper { width: 100%; max-width: 100%; overflow-x: hidden; }
    .container { padding: 16px 12px; border-radius: var(--radius-sm); max-width: 100%; box-sizing: border-box; }
    .field-grid { grid-template-columns: 1fr; gap: 14px; }
    .col-span-2 { grid-column: span 1; }
    .form-card { padding: 16px 12px; margin-bottom: 16px; width: 100%; box-sizing: border-box; }
    .card-heading, .section-title { font-size: 1.05rem; word-break: break-word; overflow-wrap: anywhere; }
    .btn-submit { width: 100%; padding: 13px 18px; font-size: 1.02rem; }
    .form-actions { text-align: stretch; margin-top: 20px; }
    .notice-box { padding: 12px 14px; font-size: 0.9rem; }
    .helpdesk-card { padding: 12px 14px; font-size: 0.88rem; }
}

@media (max-width: 480px) {
    .brand-header { padding-bottom: 12px; margin-bottom: 14px; }
    .brand-logo-wrapper { padding: 6px 12px; margin-bottom: 4px; border-radius: 8px; }
    .brand-logo { max-height: 56px; max-width: 190px; }
    .form-title, .brand-name { font-size: 1.25rem; }
    .form-description, .brand-sub { font-size: 0.88rem; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

