:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99,102,241,0.25);
  --accent: #06b6d4;
  --bg: #05070f;
  --card: #0d1117;
  --card2: #111827;
  --border: rgba(255,255,255,0.07);
  --text: #f1f5f9;
  --muted: #64748b;
  --success: #10b981;
  --error: #f87171;
  --radius: 16px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.18; animation: drift 12s ease-in-out infinite; }
.orb1 { width: 500px; height: 500px; background: #6366f1; top: -150px; left: -100px; }
.orb2 { width: 400px; height: 400px; background: #06b6d4; bottom: -100px; right: -100px; animation-delay: -4s; }
.orb3 { width: 300px; height: 300px; background: #f59e0b; top: 40%; left: 50%; animation-delay: -8s; }

@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-30px) scale(1.05); }
  66% { transform: translate(-20px,20px) scale(0.95); }
}

.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(5,7,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 1rem; }

.nav-college {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; padding: 5px 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc; border-radius: 99px;
}

.btn-logout {
  padding: 0.5rem 1.1rem;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--error); border-radius: 99px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-logout:hover { background: rgba(248,113,113,0.2); }

.auth-section {
  position: relative; z-index: 1;
  min-height: calc(100vh - 65px);
  display: grid; grid-template-columns: 1fr 1fr;
}

.auth-left {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; border-right: 1px solid var(--border);
}

.auth-brand { max-width: 400px; }

.brand-icon { font-size: 4rem; display: block; margin-bottom: 1.2rem; animation: float 3s ease-in-out infinite; }

.auth-brand h1 {
  font-size: 3rem; font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, #a5b4fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 1rem; line-height: 1.1;
}

.auth-brand p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; margin-bottom: 2rem; }
.brand-features { display: flex; flex-direction: column; gap: 0.6rem; }

.feature-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 99px; font-size: 0.88rem; color: #cbd5e1; width: fit-content;
}

.auth-right { display: flex; align-items: center; justify-content: center; padding: 3rem; }

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; padding: 2.5rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.5s ease;
}

.tab-group {
  display: flex; background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 4px; margin-bottom: 2rem; gap: 4px;
}

.tab {
  flex: 1; padding: 0.65rem; border: none; background: transparent;
  border-radius: 9px; font-family: 'Outfit', sans-serif;
  font-size: 0.9rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.2s;
}

.tab.active { background: var(--primary); color: white; box-shadow: 0 4px 16px var(--primary-glow); }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: #94a3b8; margin-bottom: 0.45rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.optional { text-transform: none; color: var(--muted); font-size: 0.75rem; }

.input-wrap { position: relative; display: flex; align-items: center; }

.input-icon { position: absolute; left: 14px; font-size: 0.95rem; pointer-events: none; z-index: 1; }

.input-wrap input {
  width: 100%; padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; color: var(--text); outline: none; transition: all 0.2s;
}

.input-wrap input::placeholder { color: var(--muted); }
.input-wrap input:focus { border-color: var(--primary); background: rgba(99,102,241,0.06); box-shadow: 0 0 0 3px var(--primary-glow); }

textarea {
  width: 100%; padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; color: var(--text); outline: none; resize: vertical; transition: all 0.2s;
}
textarea::placeholder { color: var(--muted); }
textarea:focus { border-color: var(--primary); background: rgba(99,102,241,0.06); box-shadow: 0 0 0 3px var(--primary-glow); }

.file-upload-wrap { position: relative; }
.file-upload-wrap input[type="file"] { display: none; }

.file-label {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(99,102,241,0.4);
  border-radius: 12px; cursor: pointer; transition: all 0.2s;
  font-size: 0.9rem; color: var(--muted);
}
.file-label:hover { border-color: var(--primary); background: rgba(99,102,241,0.06); color: var(--text); }
.file-icon { font-size: 1.2rem; }

/* SEARCH */
.search-wrap { position: relative; margin-bottom: 1.2rem; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; z-index: 1; }

.search-wrap input {
  width: 100%; padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; color: var(--text); outline: none; transition: all 0.2s;
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-wrap input::placeholder { color: var(--muted); }

.btn-primary {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.4rem; background: var(--primary); color: white;
  border: none; border-radius: 12px; font-family: 'Outfit', sans-serif;
  font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 28px var(--primary-glow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-arrow { font-size: 1.1rem; }

.btn-ghost {
  padding: 0.9rem 1.4rem; background: transparent;
  border: 1px solid var(--border); color: var(--muted); border-radius: 12px;
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.switch-text { text-align: center; margin-top: 1.2rem; font-size: 0.85rem; color: var(--muted); }
.switch-text a { color: #a5b4fc; cursor: pointer; font-weight: 600; }
.switch-text a:hover { text-decoration: underline; }

.msg { font-size: 0.85rem; min-height: 22px; margin-bottom: 0.6rem; text-align: center; padding: 0.3rem; }
.msg.success { color: var(--success); }
.msg.error { color: var(--error); }

.dashboard { position: relative; z-index: 1; padding: 2rem 1.5rem; animation: slideUp 0.4s ease; }
.dashboard-inner { max-width: 1100px; margin: 0 auto; }

.welcome-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(6,182,212,0.15));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px; padding: 1.8rem 2rem; margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.welcome-left { display: flex; align-items: center; gap: 1.2rem; }

.welcome-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: white; flex-shrink: 0;
}

.welcome-banner h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.25rem; }
.welcome-banner p { color: var(--muted); font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; }

.btn-add-note {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; background: var(--accent); color: white;
  border: none; border-radius: 12px; font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(6,182,212,0.3); white-space: nowrap;
}
.btn-add-note:hover { opacity: 0.88; transform: translateY(-1px); }

.add-note-card {
  background: var(--card); border: 1px solid rgba(99,102,241,0.4);
  border-radius: 20px; padding: 1.8rem; margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); animation: slideDown 0.3s ease;
}

.add-note-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.3rem; }
.add-note-header h3 { font-size: 1.05rem; font-weight: 700; }

.close-btn {
  width: 30px; height: 30px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: rgba(248,113,113,0.15); color: var(--error); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.form-actions .btn-primary { width: auto; padding: 0.8rem 1.6rem; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.section-header h3 { font-size: 1.05rem; font-weight: 700; }
.section-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; font-family: 'JetBrains Mono', monospace; }

.btn-refresh {
  padding: 0.45rem 1rem; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); color: var(--muted); border-radius: 8px;
  font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-refresh:hover { color: var(--text); background: rgba(255,255,255,0.08); }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }

.note-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: slideUp 0.3s ease both; position: relative; overflow: hidden;
}
.note-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity 0.2s;
}
.note-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.3); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.note-card:hover::before { opacity: 1; }

.note-subject {
  display: inline-block; padding: 3px 12px;
  background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc; border-radius: 99px; font-size: 0.68rem; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.8rem;
}

.note-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); line-height: 1.3; }
.note-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.8rem; }

.pdf-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.8rem; padding: 5px 14px;
  background: rgba(6,182,212,0.15); border: 1px solid rgba(6,182,212,0.3);
  color: var(--accent); border-radius: 99px; font-size: 0.78rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s;
}
.pdf-link:hover { background: rgba(6,182,212,0.25); }

.note-footer {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  border-top: 1px solid var(--border); padding-top: 0.8rem;
}

.btn-delete {
  margin-left: auto; padding: 3px 10px;
  background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3);
  color: var(--error); border-radius: 8px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.btn-delete:hover { background: rgba(248,113,113,0.25); }

.empty-state { text-align: center; padding: 5rem 2rem; color: var(--muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; display: block; }
.empty-state h4 { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; line-height: 1.7; }

.loading-state { text-align: center; padding: 4rem; color: var(--muted); }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(99,102,241,0.2); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 1rem;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .auth-section { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .welcome-banner { flex-direction: column; gap: 1rem; text-align: center; }
  .welcome-left { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
}