@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
    --font-heading: "Manrope", sans-serif;
    --font-body: "Inter", sans-serif;
    
    --primary: #00652c;
    --primary-container: #15803d;
    --on-primary: #ffffff;
    
    --bg-main: #f8fafc;
    --surface-card: #ffffff;
    --surface-container-low: #f2f4f6;
    
    --border-color: #becabc;
    --border-light: #e0e3e5;
    
    --text-primary: #191c1e;
    --text-secondary: #565e74;
    --text-muted: #6f7a6e;
    
    --danger: #dc2626;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

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

body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: transparent;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Official ITZ4U Tricolour Ambient Background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background-image: url('assets/bg_wave.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.85;
    transform: translate3d(0,0,0);
    will-change: transform;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.page-title span {
    color: var(--primary-container);
}

.page-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
}

/* Top Buttons */
.buttons button, .back-btn-inline {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-body);
}

.button_top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
}

button:hover .button_top, .back-btn-inline:hover .button_top {
    background: var(--surface-container-low);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover);
}

/* Upload Card Row Grid */
.upload-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.upload-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s ease;
}

.upload-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-label {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.type-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.type-tag.pdf   { background: #fee2e2; color: #dc2626; }
.type-tag.excel { background: #dcfce7; color: #16a34a; }
.type-tag.word  { background: #e0f2fe; color: #0284c7; }

/* File Drop Zone */
.file-upload-label {
    display: block;
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--surface-container-low);
    transition: all 0.2s ease;
}

.file-upload-label:hover, .file-upload-label.drag-over {
    border-color: var(--primary-container);
    background: #ffffff;
}

.file-upload-label input[type="file"] {
    display: none;
}

.drop-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.or-text {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 8px;
}

.browse-button {
    display: inline-block;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
}

.file-name {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    word-break: break-all;
}

.file-name.has-file {
    font-weight: 600;
    color: var(--primary);
}

.upload-msg {
    margin-top: 8px;
    font-size: 12.5px;
    text-align: center;
    display: none;
}

/* Upload Action Buttons */
.upload-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.upload-all-btn {
    width: 100%;
    max-width: 440px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.upload-all-btn .button_top {
    width: 100%;
    justify-content: center;
    padding: 14px;
    background: var(--primary-container);
    color: #ffffff;
    border-color: var(--primary-container);
    font-size: 15px;
    border-radius: 14px;
}

.upload-all-btn:hover:not(:disabled) .button_top {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.upload-all-btn:disabled .button_top {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--surface-container-low);
    color: var(--text-muted);
    border-color: var(--border-light);
}

.alt-access-row {
    display: flex;
    justify-content: center;
}

.alt-access-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Modals Overlay & Card */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.open {
    display: flex !important;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-file-list {
    margin-bottom: 20px;
}

.modal-file-item {
    background: var(--surface-container-low);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.modal-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-pwd-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.pwd-checkbox {
    accent-color: var(--primary-container);
}

.modal-pwd-field {
    display: none;
    margin-top: 10px;
}

.modal-pwd-field.visible {
    display: block;
}

.pwd-input, .portal-input {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-primary);
    outline: none;
}

.pwd-input:focus, .portal-input:focus {
    border-color: var(--primary-container);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.portal-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.portal-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.portal-security-note {
    display: flex;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px;
    margin-top: 16px;
    font-size: 12.5px;
    color: #166534;
    line-height: 1.45;
}

.modal-footer {
    display: flex;
    gap: 12px;
}

.modal-cancel-btn, .modal-confirm-btn {
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.modal-cancel-btn .button_top {
    width: 100%;
    justify-content: center;
    background: var(--surface-container-low);
    color: var(--text-primary);
}

.modal-confirm-btn .button_top {
    width: 100%;
    justify-content: center;
    background: var(--primary-container);
    color: #ffffff;
    border-color: var(--primary-container);
}

.modal-confirm-btn:hover .button_top {
    background: var(--primary);
}

/* Service Down Banner */
.service-down-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #93000a;
    color: #ffffff;
    padding: 12px 24px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 16px;
}

.service-down-title { font-weight: 700; font-size: 14px; }
.service-down-msg { font-size: 12.5px; opacity: 0.9; }
.service-down-btn { padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; text-decoration: none; }
.service-down-btn.whatsapp { background: #25d366; color: #fff; }
.service-down-btn.email { background: rgba(255,255,255,0.2); color: #fff; }
.service-down-dismiss { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: var(--font-body);
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.toast-notification.toast-error   { border-left-color: var(--danger); }
.toast-notification.toast-success { border-left-color: #16a34a; }

.toast-notification-body { flex: 1; }
.toast-notification-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; color: var(--text-primary); }
.toast-notification-msg   { color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

.toast-notification-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 18px; line-height: 1;
}

/* ── Full-Screen Modal Toast Card Overlay ─── */
.toast-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.toast-overlay.active {
    display: flex !important;
}

.toast-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    box-sizing: border-box;
}

.toast-card .toast-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 16px;
    line-height: 1;
}

.toast-card .toast-body {
    text-align: center;
    margin-bottom: 22px;
}

.toast-card .toast-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 19px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.toast-card .toast-msg {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

.toast-card .toast-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.toast-card .toast-btn:hover {
    background: var(--primary);
    transform: translateY(-1px);
}

/* Success Card Theme */
.toast-card.toast-success {
    border-top: 6px solid #16a34a;
}
.toast-card.toast-success .toast-icon {
    color: #16a34a;
}
.toast-card.toast-success .toast-title {
    color: #15803d;
}

/* Warning / Action Required Card Theme */
.toast-card.toast-warning, .toast-card.toast-rejected {
    border-top: 6px solid #f59e0b;
}
.toast-card.toast-warning .toast-icon, .toast-card.toast-rejected .toast-icon {
    color: #f59e0b;
}
.toast-card.toast-warning .toast-title, .toast-card.toast-rejected .toast-title {
    color: #b45309;
}
.toast-card.toast-warning .toast-btn, .toast-card.toast-rejected .toast-btn {
    background: #f59e0b;
}
.toast-card.toast-warning .toast-btn:hover, .toast-card.toast-rejected .toast-btn:hover {
    background: #d97706;
}

/* Error Card Theme */
.toast-card.toast-error {
    border-top: 6px solid #dc2626;
}
.toast-card.toast-error .toast-icon {
    color: #dc2626;
}
.toast-card.toast-error .toast-title {
    color: #991b1b;
}
.toast-card.toast-error .toast-btn {
    background: #dc2626;
}
.toast-card.toast-error .toast-btn:hover {
    background: #b91c1c;
}

@keyframes toastIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Footer & Policies */
.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 20px 32px;
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 640px) {
    .app-main .page-body {
        padding: 20px 14px !important;
    }
    .page-wrapper {
        padding: 20px 14px 48px;
    }
    .header-bar {
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 20px;
    }
    .brand-link { gap: 8px; min-width: 0; }
    .brand-logo { height: 34px; }
    .brand-title {
        font-size: 15px;
        line-height: 1.2;
    }
    .button_top {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
    }
    .page-header { margin-bottom: 22px; }
    .page-title { font-size: 26px; }
    .page-desc { font-size: 13px; line-height: 1.5; }
    .upload-card { border-radius: 12px; }
    .card-body { padding: 16px; }
    .modal-footer { flex-direction: column-reverse; }
    .site-footer { padding: 12px 16px; }
    .footer-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
    }
    .footer-left {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }
    .footer-links a { font-size: 11.5px; }
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 12.5px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.akshath-author {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.akshath-name {
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}

.akshath-socials {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 8px;
    z-index: 100;
}

.akshath-author:hover .akshath-socials {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.akshath-socials-inner {
    display: flex;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    padding: 6px 10px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.akshath-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-primary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.akshath-card svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.akshath-card.github:hover { color: #000000; transform: scale(1.1); }
.akshath-card.linkedin:hover { color: #0a66c2; transform: scale(1.1); }

/* ══════════════════════════════════════════════════════
   POLICY MODALS BACKDROP OVERLAY
══════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex !important;
}

.modal-backdrop .modal-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-backdrop .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-backdrop .modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-backdrop .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-backdrop .modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}
