/* ============================================
   THINKPLUS LOGIN - MATCHING LANDING PAGE THEME
   Color Palette: Deep Slate + Electric Indigo
   ============================================ */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core Colors */
  --deep-slate: #020617;
  --electric-indigo: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent-blue: #0ea5e9;
  
  /* Glass & Surface */
  --card-glass: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  /* Typography */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #6366f1, #0ea5e9);
  --gradient-text: linear-gradient(to bottom right, #ffffff, #94a3b8);
  --ambient-glow-1: rgba(99, 102, 241, 0.05);
  --ambient-glow-2: rgba(14, 165, 233, 0.05);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--deep-slate);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* === ANIMATED BACKGROUND === */
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-slate);
  z-index: 0;
}

/* Elegant mesh grid overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  pointer-events: none;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Ambient floating orbs */
.orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 25s ease-in-out infinite;
}

.orb1 {
  width: 500px;
  height: 500px;
  background: var(--ambient-glow-1);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.orb2 {
  width: 400px;
  height: 400px;
  background: var(--ambient-glow-2);
  bottom: -10%;
  right: -10%;
  animation-delay: 5s;
}

.orb3 {
  width: 300px;
  height: 300px;
  background: rgba(99, 102, 241, 0.08);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10%, -10%) scale(1.1); }
  66% { transform: translate(-10%, 10%) scale(0.9); }
}

.gradient-bg::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  background: transparent;
  pointer-events: none;
  display: none;
}

/* === LOGIN WRAPPER === */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

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

/* === LOGIN CARD === */
.login-card {
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

/* Hover glow effect */
.login-card::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 50%);
  animation: cardGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cardGlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20%, 20%); }
}

.login-card:hover {
  border-color: var(--electric-indigo);
  box-shadow: 0 25px 80px rgba(99, 102, 241, 0.3);
  transform: translateY(-5px);
}

/* === BRAND SECTION === */
.brand {
  text-align: center;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  justify-content: center;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-brand);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 0 40px var(--primary-glow);
  animation: logoGlow 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 40px var(--primary-glow); }
  50% { box-shadow: 0 0 60px var(--primary-glow), 0 0 90px rgba(99, 102, 241, 0.3); }
}

.logo span {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0 0;
}

/* === FORM STYLES === */
form {
  position: relative;
  z-index: 1;
}

.field {
  margin-bottom: 1.15rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.field input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  outline: none;
}

.field input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.field input:focus {
  border-color: var(--electric-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1),
              0 0 20px var(--primary-glow);
  background: rgba(15, 23, 42, 0.95);
}

.field input:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

/* === BUTTON === */
.btn-primary {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--gradient-brand);
  color: var(--text-primary);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
  margin-top: 0.35rem;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

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

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:disabled:hover {
  transform: none;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === FOOTER TEXT === */
.footer-text {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer-text a {
  color: var(--electric-indigo);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.footer-text a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: width 0.3s ease;
}

.footer-text a:hover {
  color: var(--accent-blue);
}

.footer-text a:hover::after {
  width: 100%;
}

/* === BACK LINK === */
.back-link {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  margin-top: -6px;
  transition: transform 0.3s ease;
}

.back-link:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--electric-indigo);
  color: var(--electric-indigo);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-2px);
}

.back-link:hover .back-arrow {
  transform: translateX(-3px);
}

.back-link:active {
  transform: translateY(0);
}

/* ============================================
   SPLIT AUTH LAYOUT
   ============================================ */

.auth-layout {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 40% 60%;
  width: 100vw;
  height: 100vh;
}

.auth-left,
.auth-right {
  width: 100%;
  height: 100%;
}

/* LEFT IMAGE PANEL */
.auth-left {
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 4px 0 20px rgba(99, 102, 241, 0.1);
}

/* Animated border gradient */
.auth-left::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  width: 5px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--electric-indigo) 30%,
    var(--accent-blue) 70%,
    transparent 100%
  );
  animation: borderPulse 4s ease-in-out infinite;
  z-index: 3;
}

@keyframes borderPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.student-image-overlay {
  position: relative;
  width: 100%;
  height: 100%;
}

.student-image-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: brightness(1.05) contrast(1.1) saturate(1.15);
}

.student-image-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(2, 6, 23, 0.65),
    rgba(2, 6, 23, 0.45),
    rgba(99, 102, 241, 0.15)
  );
}

.student-text {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  max-width: 400px;
  z-index: 2;
}

.student-text h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.student-text p {
  color: #000000;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* RIGHT PANEL */
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === CUSTOM POPUP/TOAST === */
.custom-popup {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  min-width: 320px;
  max-width: 90%;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
              0 0 0 1px rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
}

.custom-popup.show {
  top: 2rem;
  opacity: 1;
}

.popup-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  animation: popupIconPulse 2s ease-in-out infinite;
}

@keyframes popupIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.popup-icon.success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.popup-icon.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.popup-icon.info {
  background: var(--gradient-brand);
  box-shadow: 0 0 20px var(--primary-glow);
}

.popup-content {
  flex: 1;
}

.popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.popup-message {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.popup-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--electric-indigo);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* === LANDSCAPE POPUP - MOBILE ONLY === */
.landscape-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.landscape-popup-overlay.show {
  display: flex;
}

.landscape-popup {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.popup-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.popup-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

.popup-content {
  margin-bottom: 1.5rem;
}

.main-text {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.recommendation {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.recommendation:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

.recommendation .icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.recommendation p {
  margin: 0;
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.95rem;
}

.recommendation small {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

.popup-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-got-it {
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #f8fafc;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-got-it:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.btn-got-it:active {
  transform: translateY(0);
}

.dont-show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.dont-show input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #6366f1;
}

.dont-show:hover {
  color: #f8fafc;
}

/* === RESPONSIVE === */

/* DESKTOP - 1024px and above */
@media (min-width: 1024px) {
  .landscape-popup-overlay {
    display: none !important;
  }
}

/* TABLET & MOBILE - 900px and below */
@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 0;
    padding-top: 5rem;
  }

  .auth-left {
    display: none;
  }

  .auth-right {
    width: 100%;
    padding: 1rem 0 2rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: auto;
  }

  body {
    overflow-y: auto !important;
    overflow-x: hidden;
    min-height: 100vh;
  }

  .back-link {
    top: 1.5rem;
    left: 1.5rem;
    width: 44px;
    height: 44px;
    position: fixed;
    z-index: 1001;
  }

  .login-wrapper {
    padding: 1rem;
    max-width: 100%;
    width: 100%;
    margin: auto;
  }

  .login-card {
    padding: 1.5rem 1.75rem;
    border-radius: 18px;
    width: 100%;
    max-width: 380px;
  }

  .field {
    margin-bottom: 0.8rem;
  }

  .field input {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .grid-overlay {
    position: fixed;
  }

  .gradient-bg {
    position: fixed;
  }

  .orbs {
    position: fixed;
  }
}

/* SMALL MOBILE - 480px and below */
@media (max-width: 480px) {
  .back-link {
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    position: fixed;
    z-index: 1001;
  }

  body {
    overflow-y: auto !important;
    overflow-x: hidden;
  }

  .auth-layout {
    padding: 0;
    padding-top: 4.5rem;
    min-height: 100vh;
  }

  .auth-right {
    padding: 1rem 0 2rem 0;
  }

  .login-wrapper {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .login-card {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    margin: 0 auto;
    width: calc(100% - 1.5rem);
    max-width: 340px;
  }

  .field {
    margin-bottom: 0.7rem;
  }

  .field label {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }

  .field input {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .btn-primary {
    padding: 0.7rem 1.1rem;
    font-size: 0.85rem;
    margin-top: 0.3rem;
  }

  .brand p {
    font-size: 0.8rem;
  }

  .footer-text {
    font-size: 0.75rem;
    margin-top: 1rem;
  }
}

/* === HIDE POPUP ON DESKTOP === */
@media (min-width: 768px) {
  .landscape-popup-overlay {
    display: none !important;
  }
}