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

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  --bg-dark: #070a13;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(22, 33, 58, 0.9);
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-input-focus: rgba(255, 255, 255, 0.08);
  
  --border-color: rgba(255, 255, 255, 0.12);
  --border-focus: #00d2ff;
  
  --primary-glow: rgba(0, 210, 255, 0.35);
  --primary-start: #0072ff;
  --primary-end: #00d2ff;
  --primary-gradient: linear-gradient(135deg, #0072ff 0%, #00d2ff 100%);
  --accent-gradient: linear-gradient(135deg, #8a2be2 0%, #00d2ff 100%);
  
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body.auth-body, body.bg {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at 15% 15%, #111d38 0%, #070a13 55%, #03050a 100%);
  color: var(--text-white);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Background animated glow orbs */
.bg-glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.bg-glow-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #0072ff, transparent 70%);
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  bottom: -120px;
  right: -100px;
  background: radial-gradient(circle, #7928ca, transparent 70%);
  animation-duration: 22s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* Auth Container */
.auth-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.auth-wrapper-single {
  max-width: 520px;
}

/* Auth Card Structure */
.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 210, 255, 0.08);
  padding: 2.75rem 2.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

/* Card Header */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 12px rgba(0, 210, 255, 0.25));
  transition: transform 0.3s ease;
}

.auth-brand-logo:hover {
  transform: scale(1.03);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.auth-nav-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.auth-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 4px 12px;
  border-radius: 8px;
}

.auth-nav-link:hover, .auth-nav-link.active {
  color: #00d2ff;
  background: rgba(0, 210, 255, 0.1);
}

/* Modern Tab Switcher for Login Roles */
.portal-tabs-container {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 2rem;
  gap: 6px;
}

.portal-tab {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.portal-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.portal-tab.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 114, 255, 0.35);
}

/* Form Controls */
.auth-form-group {
  margin-bottom: 1.35rem;
  text-align: left;
}

.auth-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.auth-label .optional {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
}

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

.auth-input-icon {
  position: absolute;
  left: 15px;
  color: var(--text-dim);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 10px 16px 10px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input.no-icon {
  padding-left: 16px;
}

.auth-input:focus {
  background: var(--bg-input-focus);
  border-color: #00d2ff;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2);
  outline: none;
}

.auth-input:focus ~ .auth-input-icon {
  color: #00d2ff;
}

.auth-input::placeholder {
  color: #64748b;
  font-size: 0.9rem;
}

.auth-input:disabled, .auth-input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  cursor: not-allowed;
}

/* Password Toggle Icon */
.auth-password-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 3;
}

.auth-password-toggle:hover {
  color: #00d2ff;
}

/* Custom Select Dropdown */
select.auth-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.auth-input option {
  background-color: #0d1527;
  color: #ffffff;
  padding: 10px;
}

/* Sponsor Verification Status Badge */
.sponsor-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 22px;
}

.sponsor-status-valid {
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.sponsor-status-invalid {
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.sponsor-loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 210, 255, 0.3);
  border-top-color: #00d2ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Checkbox & Terms */
.auth-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 1.25rem 0;
  text-align: left;
  user-select: none;
}

.auth-checkbox-group input[type="checkbox"] {
  accent-color: #0072ff;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
}

.auth-checkbox-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
}

.auth-checkbox-label a {
  color: #00d2ff;
  text-decoration: none;
  font-weight: 500;
}

.auth-checkbox-label a:hover {
  text-decoration: underline;
}

/* Action Links (Forgot Password, etc.) */
.auth-extra-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.auth-link {
  color: #00d2ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.auth-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.auth-link-muted {
  color: var(--text-muted);
}

.auth-link-muted:hover {
  color: #00d2ff;
}

/* Primary CTA Button */
.btn-auth-primary {
  width: 100%;
  height: 50px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 114, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 210, 255, 0.45);
}

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

.btn-auth-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

.btn-auth-primary .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Success / Alert notification banners */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.auth-alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Success Receipt Layout */
.receipt-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  margin: 1.5rem 0;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.receipt-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.receipt-value {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #00d2ff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(0, 210, 255, 0.15);
  color: #ffffff;
}

/* Particles & legacy compatibility */
.starsec, .starthird, .starfourth, .starfifth {
  position: absolute;
  background: transparent;
  pointer-events: none;
}

/* Responsive Grid Helpers */
.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .auth-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
}