:root {
    --primary: #f72585;
    --primary-light: #ffb3c6;
    --accent: #4cc9f0;
    --accent-glow: rgba(76, 201, 240, 0.4);
    --secondary: #7209b7;
    --gold-accent: #fee440;
    --bg-soft: #10002b;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(76, 201, 240, 0.3);
    --text-primary: #240046;
    --text-secondary: #5a189a;
    --card-radius: 30px;
    --font-main: 'Cairo', sans-serif;
    --transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --fairy-glow: 0 0 20px rgba(247, 37, 133, 0.8), 0 0 40px rgba(76, 201, 240, 0.4);
}

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

body {
    background-color: var(--bg-soft);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(114, 9, 183, 0.6), transparent 600px),
        radial-gradient(circle at 85% 30%, rgba(247, 37, 133, 0.5), transparent 600px),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23fee440' opacity='0.7'/%3E%3Ccircle cx='90' cy='60' r='2' fill='%234cc9f0' opacity='0.5'/%3E%3Ccircle cx='150' cy='130' r='1.5' fill='%23f72585' opacity='0.8'/%3E%3C/svg%3E");
    background-size: auto, auto, 300px 300px;
    background-attachment: fixed;
    animation: breathingBackground 15s ease-in-out infinite alternate;
    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;
}

@keyframes breathingBackground {
    0% { background-position: 0% 0%, 0% 0%, 0 0; }
    100% { background-position: 5% 5%, -5% 5%, 0 50px; }
}

/* --- Mesh Background --- */
.mesh-background {
    display: none;
}

/* --- 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(114, 9, 183, 0.3), 
                inset 0 0 20px rgba(255, 255, 255, 0.7);
    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: 38px;
    font-weight: 900;
    margin-bottom: 8px;
    background: linear-gradient(to right, #f72585 0%, #7209b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 15px rgba(247, 37, 133, 0.2);
}

.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(247, 37, 133, 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;
}



/* --- 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; }
}
