﻿:root {
  --red: #8b1a1a;
  --red-dark: #5c1010;
  --red-mid: #a31e1e;
  --gold: #c97c0a;
  --gold-light: #e8970d;
  --gold-pale: #fef6e4;
  --gold-bright: #f5b730;
  --bg-deep: #2a0a0a;
  --text-primary: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e8e4df;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

/* Layered atmospheric background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 10%, rgba(201, 124, 10, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(139, 26, 26, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
    linear-gradient(160deg, #3d0e0e 0%, #1e0606 40%, #0f0205 100%);
  pointer-events: none;
  z-index: 0;
}

/* Dot-grid texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(201, 124, 10, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Decorative rings */
.deco-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.deco-ring-1 {
  width: 520px;
  height: 520px;
  bottom: -180px;
  left: -140px;
  border: 1px solid rgba(201, 124, 10, 0.1);
  box-shadow: inset 0 0 80px rgba(201, 124, 10, 0.04);
}
.deco-ring-2 {
  width: 320px;
  height: 320px;
  top: 10%;
  right: -100px;
  border: 1px solid rgba(139, 26, 26, 0.1);
}

.login-wrapper {
  max-width: 468px;
  width: 100%;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}

/* ---- Card ---- */
.login-card {
  background: rgba(255, 255, 255, 0.985);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 0 22px 22px 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-left: 4px solid var(--gold);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(201, 124, 10, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  animation: cardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}

/* Subtle top shimmer line */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 124, 10, 0.4), transparent);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- Brand block ---- */
.brand-logo-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.9rem;
  animation: iconPop 0.6s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  filter: drop-shadow(0 6px 18px rgba(92, 16, 16, 0.35));
}

@keyframes iconPop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.brand-name {
  font-family: "Sora", sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(140deg, var(--red-dark) 10%, var(--red) 60%, var(--red-mid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.brand-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 2px;
  margin: 0.6rem auto 0.55rem;
}

.brand-subtitle {
  font-size: 0.775rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---- Role pills ---- */
.role-pills {
  background: #f5f3f0;
  border-radius: 12px;
  padding: 0.28rem;
  gap: 0.28rem;
  border: 1px solid var(--border);
}

.role-pills .nav-link {
  border-radius: 9px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.825rem;
  color: var(--text-muted);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  padding: 0.52rem 1rem;
  letter-spacing: 0.1px;
}

.role-pills .nav-link:hover:not(.active) {
  color: var(--gold);
  background: var(--gold-pale);
}

.role-pills .nav-link.active {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 26, 26, 0.38);
}

.role-pills .nav-link.active i {
  color: var(--gold-bright);
}

/* ---- Form labels ---- */
.form-label {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.73rem;
  color: #374151;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ---- Input group ---- */
.input-group-text {
  background: var(--gold-pale);
  border-color: var(--border);
  color: var(--gold);
  transition: all 0.2s ease;
  width: 44px;
  justify-content: center;
  font-size: 0.88rem;
}

.form-control {
  border-color: var(--border);
  font-size: 0.875rem;
  padding: 0.62rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: var(--text-primary);
  background: #fdfdfc;
}

.form-control:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3.5px rgba(201, 124, 10, 0.15);
  background: #fffcf5;
}

.input-group:focus-within .input-group-text {
  border-color: var(--gold-light);
  background: #fffbeb;
  color: var(--gold);
}

.form-control::placeholder {
  color: #c5c8ce;
  font-size: 0.85rem;
}

/* ---- Password toggle ---- */
.btn-pass-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-left: 0;
  color: #9ca3af;
  transition: all 0.2s ease;
  padding: 0 0.75rem;
}
.btn-pass-toggle:hover {
  color: var(--gold);
  background: #fffbeb;
}
.input-group:focus-within .btn-pass-toggle {
  border-color: var(--gold-light);
}
.btn-pass-toggle:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: -2px;
  border-radius: 0 0.375rem 0.375rem 0;
  color: var(--gold);
}

/* ---- Login button ---- */
.btn-login {
  background: linear-gradient(140deg, var(--red) 0%, var(--red-dark) 100%);
  border: none;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  padding: 0.78rem;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.45s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(92, 16, 16, 0.45);
  color: #fff;
}

.btn-login:hover::before {
  left: 150%;
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(92, 16, 16, 0.3);
}

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

/* ---- Register button ---- */
.btn-register {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border: none;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  padding: 0.78rem;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(201, 124, 10, 0.42);
  color: #fff;
}

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

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

/* ---- Sign-up button ---- */
.btn-signup {
  border: 1.5px solid var(--gold);
  color: var(--gold);
  background: transparent;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  letter-spacing: 0.15px;
  transition: all 0.22s ease;
}
.btn-signup:hover {
  background: rgba(201, 124, 10, 0.09);
  border-color: var(--gold-light);
  color: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201, 124, 10, 0.2);
}

/* Divider */
.signup-divider-text {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
  padding: 0 0.6rem;
}
.signup-divider-line {
  border-color: rgba(0, 0, 0, 0.08);
}

/* ---- Form divider ---- */
.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  font-family: "Sora", sans-serif;
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.form-divider::before,
.form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Alerts ---- */
.alert-danger {
  font-size: 0.84rem;
  border-radius: 9px;
  border: none;
  border-left: 3px solid #ef4444;
  background: #fef2f2;
  color: #991b1b;
}
.alert-success {
  border-radius: 9px;
  border: none;
  border-left: 3px solid #10b981;
  font-size: 0.84rem;
  background: #f0fdf4;
}

/* Toggle links */
.toggle-link {
  font-size: 0.845rem;
  color: #6b7280;
}
.toggle-link a {
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

#showRegisterLink {
  color: var(--gold);
}
#showRegisterLink:hover {
  color: var(--gold-light);
}
#showLoginLink {
  color: var(--red);
}
#showLoginLink:hover {
  color: var(--red-dark);
}

/* ---- Footer ---- */
.footer-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  text-align: center;
  margin-top: 1.5rem;
  letter-spacing: 0.3px;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .login-card {
    border-radius: 0 16px 16px 0;
  }
  .brand-name {
    font-size: 1.75rem;
  }
  .brand-logo-img {
    width: 72px;
    height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .brand-logo-img {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .btn-login,
  .btn-register,
  .btn-signup {
    transition: none;
  }
  .btn-login:hover,
  .btn-register:hover,
  .btn-signup:hover {
    transform: none;
    box-shadow: none;
  }
  .btn-login::before {
    display: none;
  }
}
