:root {
  --deep: #181b21;
  --bg: #f8fafd;
  --glass: rgba(253,252,253,0.95);
  --soft-shadow: 0 10px 38px 0 rgba(255,255,255,0.2), 0 1px 20px rgba(11,21,49,0.1);
  --brand-main: #0446b1;
  --brand-text: #0d2140;
  --mono: 'JetBrains Mono', monospace;
  --primary: #f7ba12;
  --accent1: #39b9e9;
  --success: #28a745;
  --error: #dc3545;
  --border-radius: 1rem;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--brand-text);
  font-family: 'Inter', Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  font-size: 16px;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 50%, #ffe8a2 100%);
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--soft-shadow);
}

.brand-logo {
  width: 60px;
  height: 60px;
  vertical-align: -18%;
  margin-bottom: 0.5rem;
}

h1 {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--brand-main);
  font-size: 2.5rem;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

h2 {
  color: #283c56;
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0.5rem 0 1rem 0;
}

h3, h4 {
  color: var(--brand-main);
}

/* Navigation */
nav {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: var(--transition);
}

nav a:hover {
  color: var(--accent1);
  background: rgba(255,255,255,0.3);
}

/* Buttons */
.cta-btn, .cta-btn:visited {
  background: linear-gradient(90deg, #ffe296, #f6c12c 60%);
  color: #2f2906;
  border: none;
  padding: 0.85rem 2.2rem;
  font-weight: 700;
  font-size: 1.13rem;
  border-radius: 2rem;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(255, 214, 49, 0.3);
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}

.cta-btn:hover, .cta-btn:focus {
  background: linear-gradient(90deg, #ffd644, #fac815 60%, #f5d341 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 214, 49, 0.4);
}

/* Hero Section */
.hero-main {
  max-width: 800px;
  margin: 0 auto 3rem auto;
  padding: 2rem 1rem;
  text-align: center;
}

.hero-main h1 {
  margin-bottom: 1rem;
  font-size: 2.2rem;
}

.hero-msg {
  font-size: 1.14rem;
  color: #3c475a;
  padding: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

/* Categories Grid */
.categories-venn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.cat-panel {
  background: var(--glass);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--soft-shadow);
  text-align: left;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.2);
}

.cat-panel:hover {
  box-shadow: 0 16px 47px rgba(244, 186, 22, 0.2), 0 3px 18px rgba(24, 49, 255, 0.1);
  transform: translateY(-5px) scale(1.02);
}

.cat-panel svg, .cat-panel img {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
}

.cat-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-main);
  margin-bottom: 1rem;
}

.cat-list {
  margin-bottom: 1.5rem;
}

.cat-list div {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-more {
  background: rgba(255,255,255,0.8);
  padding: 0.7rem 1.5rem;
  border-radius: 0.7rem;
  color: var(--brand-main);
  border: 1px solid #e5e6fe;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  display: inline-block;
}

.btn-more:hover {
  background: var(--brand-main);
  color: #fff;
}

/* Course Cards */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.course-card {
  background: var(--glass);
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.2);
}

.course-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(244, 186, 22, 0.3), 0 5px 25px rgba(24, 49, 255, 0.1);
}

.course-banner {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(244, 186, 22, 0.1) 100%);
}

.course-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.course-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-main);
  margin-bottom: 0.5rem;
}

.course-desc {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
}

.meta-row {
  font-size: 0.9rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Progress Bar */
.progress-bar-wrap {
  background: #e7e9eb;
  border-radius: 1.6rem;
  height: 15px;
  width: 100%;
  margin: 0.8rem 0 0.5rem 0;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #ffc604 0%, #f2e587 100%);
  height: 100%;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.55, 1.3, 0.55, 1);
  border-radius: 1.6rem;
}

.progress-label {
  font-size: 0.9rem;
  color: #cfad10;
  padding-left: 0.5rem;
}

/* Forms */
.login-card, .signup-card, .form-panel {
  background: var(--glass);
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  max-width: 450px;
  margin: 2rem auto;
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,0.2);
}

.form-title {
  text-align: center;
  color: var(--brand-main);
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

label {
  display: block;
  margin: 1rem 0 0.3rem 0;
  font-weight: 600;
  color: var(--brand-text);
}

input[type=password], input[type=email], input[type=text] {
  width: 100%;
  padding: 1rem;
  border-radius: 0.6rem;
  border: 2px solid #e5deb0;
  background: #f6fafb;
  color: #222;
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: var(--transition);
}

input[type=password]:focus, input[type=email]:focus, input[type=text]:focus {
  outline: none;
  border-color: var(--brand-main);
  box-shadow: 0 0 0 3px rgba(4, 70, 177, 0.1);
}

.math-challenge {
  background: rgba(247, 186, 18, 0.1);
  padding: 1rem;
  border-radius: 0.6rem;
  border: 2px solid rgba(247, 186, 18, 0.3);
  margin: 1rem 0;
}

.math-challenge label {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

button, .primary-btn {
  background: linear-gradient(90deg, #f7df63, #fffcec 90%);
  color: #3e2c0e;
  font-weight: 700;
  font-size: 1.11rem;
  border: none;
  padding: 1rem 2.4rem;
  border-radius: 2rem;
  box-shadow: 0 2px 10px rgba(255, 204, 136, 0.3);
  cursor: pointer;
  margin-top: 1rem;
  transition: var(--transition);
  width: 100%;
}

button:hover, .primary-btn:hover {
  background: linear-gradient(90deg, #fcee1c, #f6c204 80%, #f7b933 100%);
  transform: translateY(-2px);
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error);
  padding: 1rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(220, 53, 69, 0.3);
  margin-bottom: 1rem;
}

.success-message {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
  padding: 1rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(40, 167, 69, 0.3);
  margin-bottom: 1rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 3rem 1.5rem 1.5rem;
  background: linear-gradient(90deg, #fdf7ef 0%, #c6d0da 90%);
  font-size: 0.98rem;
  text-align: center;
  color: #222;
  box-shadow: 0 -2px 22px rgba(187, 187, 255, 0.04);
}

.brand-thin {
  font-weight: 700;
  color: var(--brand-main);
}

.credits, .credits a {
  font-size: 0.93rem;
  color: #888;
  text-decoration: none;
  display: block;
  margin: 1.5rem auto 0.7rem;
}

.credits a:hover {
  color: var(--brand-main);
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .brand-logo {
    width: 45px;
    height: 45px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .hero-main h1 {
    font-size: 1.8rem;
  }
  
  .hero-msg {
    font-size: 1rem;
  }
  
  nav {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  nav a {
    padding: 0.7rem 1.5rem;
  }
  
  .categories-venn-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }
  
  .courses-grid {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
  
  .cat-panel {
    padding: 1.5rem;
  }
  
  .login-card, .signup-card, .form-panel {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  
  header {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .hero-main h1 {
    font-size: 1.6rem;
  }
  
  .cta-btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
  }
  
  .login-card, .signup-card, .form-panel {
    padding: 1.5rem 1rem;
  }
  
  input[type=password], input[type=email], input[type=text] {
    padding: 0.8rem;
  }
  
  button, .primary-btn {
    padding: 0.8rem 2rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ffe093, #fffff7 80%);
  border-radius: 7px;
}

::-webkit-scrollbar-track {
  background: #f6f0ef;
}