:root {
    --bg-main: #090e17;
    --bg-card: rgba(22, 27, 34, 0.5);
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.1);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 15px 35px rgba(59, 130, 246, 0.2);
    --danger: #f85149;
    --success: #2ea043;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-elements {
    display: none;
}

.portal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 20px;
}

/* Header */
.portal-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 5.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.portal-header p {
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin: 0 auto;
    gap: 40px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 60px 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    transition: none;
    z-index: 0;
}

.menu-card:hover::before {
    animation: shine 1s ease;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

.menu-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(30, 41, 59, 0.7);
}

.card-icon {
    background: var(--primary-light);
    width: 140px;
    height: 140px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.menu-card:hover .card-icon {
    background: var(--primary);
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.card-icon i {
    font-size: 5rem;
    color: var(--primary);
    transition: color 0.3s ease;
}

.menu-card:hover .card-icon i {
    color: #fff;
    animation: pulseIcon 1.5s infinite alternate;
}

@keyframes pulseIcon {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.menu-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}

.menu-card p {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Form Container */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-md);
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 30px;
}

.back-btn:hover {
    background: var(--border-color);
    color: #fff;
}

.form-container h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-description {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Form Fields */
.field-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.field-group:nth-child(1) { animation-delay: 0.1s; }
.field-group:nth-child(2) { animation-delay: 0.15s; }
.field-group:nth-child(3) { animation-delay: 0.2s; }
.field-group:nth-child(4) { animation-delay: 0.25s; }
.field-group:nth-child(5) { animation-delay: 0.3s; }
.field-group:nth-child(6) { animation-delay: 0.35s; }
.field-group:nth-child(7) { animation-delay: 0.4s; }
.field-group:nth-child(8) { animation-delay: 0.45s; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.req {
    color: var(--danger);
    margin-left: 4px;
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: -4px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.radio-group {
    display: flex;
    gap: 20px;
    background: var(--bg-main);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.radio-label input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-top: 40px;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    font-size: 5rem;
    color: var(--success);
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

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

.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .portal-container { padding: 30px 15px; }
    .form-container { padding: 30px 20px; }
    .logo h1 { font-size: 1.8rem; }
    .form-container h2 { font-size: 1.6rem; }
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.ecg-line {
    width: 400px;
    height: 150px;
}

.ecg-line path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawEcg 2.5s linear forwards;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.9));
}

@keyframes drawEcg {
    to { stroke-dashoffset: 0; }
}

/* Stats */
.portal-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
    padding-bottom: 50px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px 40px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.stat-item i {
    font-size: 24px;
    color: var(--primary);
    margin-right: 10px;
    vertical-align: middle;
}

.stat-item span {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    vertical-align: middle;
}

.stat-label {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Staff Link in Header */
.staff-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 24px;
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 12px;
    color: #818cf8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.staff-link:hover {
    background: rgba(88, 101, 242, 0.18);
    border-color: rgba(88, 101, 242, 0.4);
    color: #a5b4fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

.staff-link i:last-child {
    transition: transform 0.3s;
}

.staff-link:hover i:last-child {
    transform: translateX(4px);
}

/* =========================================
   PREMIUM BACKGROUND EFFECTS & 3D HOVER
   ========================================= */


.bg-orbs {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 20s infinite ease-in-out alternate;
}

.orb-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    animation-delay: 0s;
}

.orb-2 {
    bottom: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.12) 0%, transparent 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%; left: 60%;
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 5%) scale(1.1); }
    100% { transform: translate(-5%, 10%) scale(0.9); }
}

/* Enhancing existing menu-card with 3D feel */
.menu-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-card:hover {
    transform: translateY(-12px) scale(1.03) perspective(1000px) rotateX(2deg);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

