:root {
    --primary: #fb7185; /* Soft Rose */
    --primary-light: #fda4af;
    --accent: #f472b6;
    --accent-glow: rgba(244, 114, 182, 0.2);
    --bg-soft: #fff1f2;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(251, 113, 133, 0.2);
    --text-primary: #881337;
    --text-secondary: #be123c;
    --card-radius: 40px;
    --font-main: 'Alexandria', sans-serif;
    --transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-soft);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* --- Mesh Background --- */
.mesh-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.mesh-gradient {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(at 0% 0%, #ffe4e6 0, transparent 50%), 
        radial-gradient(at 50% 0%, #fae8ff 0, transparent 50%), 
        radial-gradient(at 100% 0%, #fef3c7 0, transparent 50%), 
        radial-gradient(at 50% 100%, #fff1f2 0, transparent 50%), 
        radial-gradient(at 0% 100%, #fce7f3 0, transparent 50%);
    filter: blur(60px);
    opacity: 0.8;
    animation: mesh-rotate 30s linear infinite;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
}

@keyframes mesh-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* --- Layout --- */
.main-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    z-index: 10;
}

.section-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* --- Glass Card (Login) --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 2px solid white;
    border-radius: var(--card-radius);
    padding: 60px 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 60px -10px rgba(251, 113, 133, 0.15), 
                inset 0 0 20px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-align: center;
    transition: var(--transition);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0.8;
}

.logo-wrapper {
    width: 110px;
    height: 110px;
    margin: 0 auto 30px;
    filter: drop-shadow(0 8px 15px rgba(251, 113, 133, 0.3));
    animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.brand-header h1 {
    font-size: 34px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tagline {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 50px;
    font-weight: 600;
}

.instruction {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 40px; /* Increased margin to prevent overlap */
    line-height: 1.6;
}

/* --- Premium Form --- */
.premium-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.field-container {
    position: relative;
    width: 100%;
}

.field-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 26px;
    text-align: center;
    letter-spacing: 12px;
    transition: var(--transition);
}

.field-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.1);
}

.field-container label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    padding-right: 10px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px -10px rgba(139, 92, 246, 0.6);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.primary-btn:hover .btn-shine {
    left: 100%;
}

/* --- Dashboard --- */
.dashboard-head {
    text-align: right;
    margin-bottom: 48px;
    width: 100%;
}

.welcome-text h2 {
    font-size: 40px;
    font-weight: 900;
    margin-bottom: 8px;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 18px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
}

.subject-tile {
    position: relative;
    background: white;
    border: 2px solid transparent;
    border-radius: 28px;
    padding: 32px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(251, 113, 133, 0.05);
}

.subject-tile:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(251, 113, 133, 0.15);
}

.tile-icon {
    width: 65px;
    height: 65px;
    background: var(--bg-soft);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition);
}

.subject-tile:hover .tile-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(-5deg);
}

.tile-info h3 {
    font-size: 22px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tile-info span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tile Colors */
.arabic:hover { --primary: #f43f5e; }
.math:hover { --primary: #0ea5e9; }
.science:hover { --primary: #22c55e; }
.english:hover { --primary: #eab308; }
.social:hover { --primary: #a855f7; }

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    border: 1px solid var(--primary-light);
    padding: 16px 28px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 20px 40px rgba(251, 113, 133, 0.2);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
    color: var(--text-primary);
    font-weight: 700;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 20px;
}

/* --- Animations --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-text h2 { font-size: 32px; }
    .subjects-grid { grid-template-columns: 1fr; }
    .glass-card { padding: 40px 24px; }
}
