@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-color: #050508;
  --panel-bg: rgba(15, 15, 25, 0.55);
  --panel-border: rgba(139, 92, 246, 0.15);
  --primary-glow: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --primary-hover: linear-gradient(135deg, #9f75ff 0%, #5195ff 100%);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  --accent: #a78bfa;
  --accent-blue: #60a5fa;
  --danger: #ef4444;
  --success: #10b981;

  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus-bg: rgba(255, 255, 255, 0.06);
  --btn-secondary-bg: rgba(255, 255, 255, 0.05);
  --btn-secondary-border: rgba(255, 255, 255, 0.08);
  --btn-social-bg: rgba(255, 255, 255, 0.03);
  --btn-social-border: rgba(255, 255, 255, 0.06);
  --divider-border: rgba(255, 255, 255, 0.08);
  --orb-opacity: 0.25;
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --card-hover-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.1);
  --footer-bg: rgba(5, 5, 8, 0.8);
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.7);
  --panel-border: rgba(139, 92, 246, 0.2);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dark: #94a3b8;
  --accent: #7c3aed;
  --accent-blue: #2563eb;

  --input-bg: rgba(15, 23, 42, 0.03);
  --input-border: rgba(15, 23, 42, 0.1);
  --input-focus-bg: rgba(15, 23, 42, 0.05);
  --btn-secondary-bg: rgba(15, 23, 42, 0.04);
  --btn-secondary-border: rgba(15, 23, 42, 0.08);
  --btn-social-bg: rgba(15, 23, 42, 0.03);
  --btn-social-border: rgba(15, 23, 42, 0.08);
  --divider-border: rgba(15, 23, 42, 0.08);
  --orb-opacity: 0.1;
  --card-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  --card-hover-shadow: 0 30px 60px rgba(15, 23, 42, 0.09), 0 0 30px rgba(139, 92, 246, 0.12);
  --footer-bg: rgba(248, 250, 252, 0.95);
}

/* Auth layout wrapper */
.auth-wrapper {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease-out;
}

/* Card controls container (above the window) */
.card-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  width: 100%;
  z-index: 10;
}

.control-btn {
  background: var(--input-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.control-btn:hover {
  background: var(--input-focus-bg);
  border-color: var(--accent);
}

.control-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Custom Dropdown Styling */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  background: var(--input-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dropdown-trigger:hover {
  border-color: var(--accent);
  background: var(--input-focus-bg);
}

.dropdown-trigger .arrow {
  transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-trigger .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 6px;
  min-width: 150px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-height: 250px;
  overflow-y: auto;
}

/* Custom scrollbar for the menu */
.dropdown-menu::-webkit-scrollbar {
  width: 4px;
}
.dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--input-border);
  border-radius: 4px;
}

.custom-dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-item.selected {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  font-weight: 600;
}

.flag-icon {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  display: block;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* Background glowing orbs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  opacity: var(--orb-opacity);
  pointer-events: none;
}
body::before {
  top: 10%;
  left: -100px;
  background: #7c3aed;
}
body::after {
  bottom: 10%;
  right: -100px;
  background: #2563eb;
}

.container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Glassmorphic Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  padding: 48px 40px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.glass-panel:hover {
  box-shadow: var(--card-hover-shadow);
}

/* Logo */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
  text-decoration: none;
}

.logo-mark {
  width: 64px;
  height: 64px;
  background: var(--primary-glow);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1.5px;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.logo-mark::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  animation: shine 6s infinite linear;
}

@keyframes shine {
  0% { transform: translate(-50%, -50%) rotate(45deg); }
  100% { transform: translate(50%, 50%) rotate(45deg); }
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--text-main) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Forms */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent);
  background: var(--input-focus-bg);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 15px;
  background: var(--primary-glow);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

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

.btn-secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Social Buttons Grid */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.btn-social {
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-social-bg);
  border: 1px solid var(--btn-social-border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-social:hover {
  background: var(--btn-social-bg);
  border-color: var(--accent);
}

.btn-social svg {
  width: 18px;
  height: 18px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 28px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--divider-border);
}

.divider:not(:empty)::before {
  margin-right: 16px;
}

.divider:not(:empty)::after {
  margin-left: 16px;
}

/* Headings */
.title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  text-align: center;
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-dark);
  border-top: 1px solid var(--panel-border);
  background: var(--footer-bg);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Alerts / Messages */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 24px;
  display: none;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  display: block;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  display: block;
}

/* Code Inputs for OTP */
.otp-input-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 24px;
}

.otp-box {
  width: 50px;
  height: 56px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.otp-box:focus {
  border-color: var(--accent);
  background: var(--input-focus-bg);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Dashboard Layout */
.dashboard-container {
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  margin: 40px auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.nav-sidebar {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 24px;
  height: fit-content;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 550;
  font-size: 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.1);
  color: var(--accent);
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dashboard-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 32px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 16px;
}

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Active Sessions List */
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.session-item:last-child {
  border-bottom: none;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-device {
  font-size: 14px;
  font-weight: 600;
}

.session-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-revoke {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-revoke:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}
