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

/* CSS Variables */
:root {
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    
    /* Color Palette */
    --color-bg: #F8FAFC;
    --color-white: #ffffff;
    --color-brand: #234280; /* Official MITEC Blue */
    --color-brand-hover: #1c3263; /* Darker blue for hover states */
    --color-brand-bg-light: rgba(35, 66, 128, 0.05);
    --color-brand-border-light: rgba(35, 66, 128, 0.1);
    
    --color-accent: #f5911f; /* MITEC Gold Accent */
    --color-accent-hover: #d47b15;
    --color-gradient-start: #234280;
    --color-gradient-end: #076571;
    
    --color-footer-bg: #0c1524; /* Corporate dark navy */
    
    /* Slate Gray Scale */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-800: #1e293b;
    
    /* Shadows - Updated to use brand color hue for a cohesive glow */
    --shadow-sm: 0 4px 20px -2px rgba(35, 66, 128, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(35, 66, 128, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(35, 66, 128, 0.12);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-slate-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-slate-100);
}
::-webkit-scrollbar-thumb {
    background: var(--color-slate-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-brand);
}

/* Selection */
::selection {
    background-color: var(--color-brand);
    color: var(--color-white);
}

/* Layout Utilities & Containers */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.container-fluid {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Header */
.site-header {
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: all var(--transition-normal);
}

.header-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.brand:hover .brand-logo-img {
    transform: scale(1.02);
}

.brand-divider {
    width: 1px;
    height: 24px;
    background-color: var(--color-slate-200);
    margin: 0 0.25rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
    color: var(--color-brand);
    line-height: 1.2;
}

.brand-title span {
    font-weight: 300;
}

.brand-subtitle {
    font-size: 9px;
    color: var(--color-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    margin-top: -2px;
}

/* Global Status & Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-brand-bg-light);
    border: 1px solid var(--color-brand-border-light);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-brand);
}

.status-dot {
    position: relative;
    display: flex;
    height: 8px;
    width: 8px;
}

.status-dot .ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    background-color: var(--color-brand);
    opacity: 0.75;
}

.status-dot .dot {
    position: relative;
    display: inline-flex;
    border-radius: 9999px;
    height: 8px;
    width: 8px;
    background-color: var(--color-brand);
}

@keyframes ping {
    75%, 100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background-color: var(--color-brand);
    color: var(--color-white);
    padding: 0.5rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--color-brand-hover);
}

/* Mobile Support Trigger */
.btn-mobile-support {
    display: none;
    background-color: var(--color-slate-100);
    border: 1px solid var(--color-slate-200);
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--color-brand);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-mobile-support:hover {
    background-color: var(--color-slate-200);
}

.btn-mobile-support svg {
    width: 24px;
    height: 24px;
    display: block;
}

@media (max-width: 768px) {
    .header-actions {
        display: none;
    }
    .btn-mobile-support {
        display: block;
    }
}

/* Main Area */
.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    .main-content {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Portal Cards Gateway */
.portal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .portal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .portal-grid {
        gap: 3rem;
    }
}

.portal-card {
    position: relative;
    background-color: var(--color-white);
    border: 1px solid var(--color-slate-200);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

@media (min-width: 640px) {
    .portal-card {
        padding: 2rem;
    }
}

.portal-card:hover {
    border-color: var(--color-brand);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.icon-wrapper {
    height: 48px;
    width: 48px;
    background-color: var(--color-brand-bg-light);
    border: 1px solid var(--color-brand-border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.badge {
    font-size: 10px;
    font-weight: 800;
    background-color: var(--color-brand-bg-light);
    color: var(--color-brand);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--color-brand-border-light);
}

.meta-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-slate-400);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.portal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-brand);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

@media (min-width: 640px) {
    .portal-title {
        font-size: 1.875rem;
    }
}

.portal-desc {
    color: var(--color-slate-600);
    font-size: 0.875rem;
    line-height: 1.625;
    margin-bottom: 1.5rem;
}

.features-section {
    border-top: 1px solid var(--color-slate-100);
    padding-top: 1.5rem;
    margin-bottom: 2rem;
}

.features-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-brand);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-slate-600);
}

.features-list svg {
    width: 16px;
    height: 16px;
    color: var(--color-brand);
    margin-top: 2px;
    flex-shrink: 0;
}

.cta-container {
    padding-top: 1rem;
    margin-top: auto;
}

.btn-launch {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    color: var(--color-white);
    background-color: var(--color-brand);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-launch:hover {
    background-color: var(--color-brand-hover);
    transform: scale(1.01);
}

.btn-launch:active {
    transform: scale(0.95);
}

.btn-launch svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.portal-card:hover .btn-launch svg {
    transform: translateX(4px);
}

.redirect-notice {
    text-align: center;
    font-size: 11px;
    color: var(--color-slate-400);
    margin-top: 0.75rem;
    font-family: monospace;
}

/* Footer Section */
.site-footer {
    border-top: 1px solid rgba(10, 29, 55, 0.1);
    background-color: var(--color-footer-bg);
    padding-top: 3rem;
    padding-bottom: 3rem;
    color: var(--color-slate-400);
}

.footer-top {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-top {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.footer-divider {
    background-color: rgba(255, 255, 255, 0.15);
}

.footer-brand-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.2;
}

.footer-brand-subtitle {
    font-size: 10px;
    color: var(--color-slate-400);
    display: block;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    list-style: none;
    font-size: 0.75rem;
}

.footer-links a {
    color: var(--color-slate-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-slate-400);
}

@media (min-width: 640px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.secure-infrastructure {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-slate-300);
}

.secure-infrastructure svg {
    width: 18px;
    height: 18px;
    color: var(--color-white);
}

.footer-copyright-bar {
    background: linear-gradient(45deg, var(--color-gradient-start), var(--color-gradient-end));
    padding: 1.25rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.025em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Engine styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--color-white);
    border: 1px solid var(--color-slate-200);
    width: 100%;
    max-width: 32rem; /* Max-w-lg */
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

@media (min-width: 640px) {
    .modal-content {
        padding: 2rem;
    }
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-brand);
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--color-slate-500);
    margin-top: 0.25rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--color-slate-400);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--color-brand);
    background-color: var(--color-slate-100);
}

.btn-close-modal svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Form Styling */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background-color: var(--color-slate-50);
    border: 1px solid var(--color-slate-200);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-brand);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: var(--color-slate-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 1px var(--color-brand);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
}

.form-notice {
    display: none;
    background-color: var(--color-brand-bg-light);
    border: 1px solid rgba(10, 29, 55, 0.2);
    padding: 0.875rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--color-brand);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.form-notice.visible {
    display: block;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-slate-100);
}

.btn-cancel {
    background: none;
    border: none;
    color: var(--color-slate-500);
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-cancel:hover {
    background-color: var(--color-slate-100);
}

.btn-submit {
    background-color: var(--color-brand);
    color: var(--color-white);
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-submit:hover {
    background-color: var(--color-brand-hover);
}
