/* ===================================================
   Login Page — Premium Dark Theme
   =================================================== */

.login-page {
  display: flex;
  min-height: 100vh;
  background: #060c1a;
  position: relative;
  overflow: hidden;
  font-family: var(--font);
}

/* ---- Layered background ---- */
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 15% 60%, rgba(37, 99, 235, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 100% at 85% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 60% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

/* Floating orbs */
.login-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-drift 12s ease-in-out infinite alternate;
}
.login-bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 45%;
  height: 55%;
  background: radial-gradient(circle, rgba(16,185,129,0.09) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-drift 16s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4%, 3%) scale(1.08); }
}

/* ---- Left branding panel ---- */
.login-panel-left {
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 4rem 4rem 5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 1024px) {
  .login-panel-left {
    display: flex;
    flex: 1;
  }
}

.login-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.325rem 0.875rem;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 2.25rem;
  width: fit-content;
  font-family: 'Inter', sans-serif;
}

.login-brand-title {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.375rem;
}

.login-brand-title span {
  background: linear-gradient(135deg, #60a5fa 0%, #34d399 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand-desc {
  font-size: 0.975rem;
  color: #475569;
  line-height: 1.75;
  max-width: 400px;
  margin-bottom: 2.75rem;
}

/* Edition cards */
.login-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: all 0.25s;
}
.login-feature-item:hover {
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
}

.login-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

/* ---- Right form panel ---- */
.login-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
  width: 100%;
}

@media (min-width: 1024px) {
  .login-panel-right {
    width: 500px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.05);
    background: rgba(6, 12, 26, 0.5);
    backdrop-filter: blur(12px);
  }
}

/* ---- Card ---- */
.login-card {
  width: 100%;
  max-width: 420px;
  animation: loginCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.login-card-inner {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(24px);
  box-shadow:
    0 32px 64px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset;
}

/* ---- Logo ---- */
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
  flex-shrink: 0;
}

.login-logo-text-main {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.login-logo-text-sub {
  font-size: 0.68rem;
  color: #475569;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  margin-top: 0.1rem;
}

/* ---- Heading ---- */
.login-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.login-subheading {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ---- Role selector ---- */
.role-selector-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  margin-bottom: 0.625rem;
  font-family: 'Inter', sans-serif;
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.role-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.875rem 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #64748b;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  outline: none;
}

.role-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.role-btn.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.25);
}

.role-btn.active.hq {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  box-shadow: 0 8px 20px rgba(245,158,11,0.2);
}

.role-btn.active.region {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37,99,235,0.2);
}

.role-btn.active.participant {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  box-shadow: 0 8px 20px rgba(16,185,129,0.2);
}

.role-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.role-btn.active .role-btn-icon { background: rgba(255, 255, 255, 0.14); }

.role-btn-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

/* ---- Form ---- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.125rem;
  transition: all 0.25s ease;
}

.login-field.hidden-field { display: none; }

.login-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  font-family: 'Inter', sans-serif;
}

.login-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.login-input:focus {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-input::placeholder { color: #334155; }

.login-input option {
  background: #1e293b;
  color: #f1f5f9;
}

/* ---- Login button ---- */
.login-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  border-radius: 11px;
  pointer-events: none;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5), 0 1px 0 rgba(255,255,255,0.15) inset;
}

.login-btn:active:not(:disabled) { transform: translateY(0); }

.login-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-btn.role-hq {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.login-btn.role-hq:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.5), 0 1px 0 rgba(255,255,255,0.15) inset;
}

.login-btn.role-participant {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.login-btn.role-participant:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.5), 0 1px 0 rgba(255,255,255,0.15) inset;
}

/* ---- Messages ---- */
.login-message {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 1.125rem;
  display: none;
  animation: msgFadeIn 0.25s ease;
}

.login-message.show { display: block; }

.login-message.error {
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #fca5a5;
}

.login-message.success {
  background: rgba(5, 150, 105, 0.14);
  border: 1px solid rgba(5, 150, 105, 0.28);
  color: #6ee7b7;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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