/**
 * Authentication Modal & UI Styles
 */

/* =========================
   AUTH UI (Header Buttons)
========================= */

.auth-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
}

.login-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.09);
}

.login-btn:hover {
  background: rgba(230,57,70,0.08);
  color: #e63946;
  border-color: rgba(230,57,70,0.25);
}

.signup-btn {
  background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
  color: #fff;
  border: none;
  box-shadow: 0 3px 12px rgba(230,57,70,0.35);
}

.signup-btn:hover {
  box-shadow: 0 5px 18px rgba(230,57,70,0.5);
  transform: translateY(-1px);
}

/* User Menu */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(230,57,70,0.07);
  border: 1px solid rgba(230,57,70,0.18);
  border-radius: 12px;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.user-menu-trigger:hover {
  background: rgba(230,57,70,0.13);
  border-color: rgba(230,57,70,0.35);
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e63946;
  font-weight: 600;
}

.premium-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0d1117;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: linear-gradient(160deg, rgba(14,20,36,0.99) 0%, rgba(10,14,24,0.99) 100%);
  border: 1px solid rgba(230,57,70,0.18);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  z-index: 1000;
  animation: fadeIn 0.18s ease;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  color: #e5e7eb;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: rgba(230,57,70,0.1);
  color: #e63946;
}

/* =========================
   AUTH MODAL
========================= */

.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal[aria-hidden="false"] {
  display: flex;
  animation: amFadeIn 0.2s ease;
}

@keyframes amFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7,10,18,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Modal card ─────────────────────────────────────── */
.auth-modal-content {
  position: relative;
  background:
    radial-gradient(circle at 88% 18%, rgba(230,57,70,0.11) 0%, transparent 46%),
    linear-gradient(160deg, rgba(14,20,36,0.99) 0%, rgba(10,14,24,0.99) 100%);
  border: 1px solid rgba(230,57,70,0.22);
  border-radius: 22px;
  max-width: 440px;
  width: 100%;
  padding: 36px 36px 32px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.03);
  animation: slideUp 0.28s cubic-bezier(0.16,1,0.3,1);
  max-height: 90vh;
  overflow-y: auto;
}

/* Red top accent line */
.auth-modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(230,57,70,0.9) 25%, rgba(230,57,70,0.9) 75%, transparent 100%);
  border-radius: 22px 22px 0 0;
  z-index: 2;
}

/* ── Close button ───────────────────────────────────── */
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #7f8ea3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 3;
}

.auth-modal-close:hover {
  background: rgba(230,57,70,0.12);
  border-color: rgba(230,57,70,0.3);
  color: #e63946;
}

/* =========================
   TABS
========================= */

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #7f8ea3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 9px;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.auth-tab:hover {
  color: #e5e7eb;
  background: rgba(255,255,255,0.04);
}

.auth-tab.active {
  background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(230,57,70,0.35);
}

/* =========================
   FORM HEADER
========================= */

.auth-form-container h2 {
  color: #e5e7eb;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  color: #7f8ea3;
  font-size: 13.5px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* =========================
   FORMS
========================= */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Google Login Button */
.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.96);
  color: #3c4043;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.google-login-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.google-login-btn svg { flex-shrink: 0; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2px 0;
}

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

.auth-divider span {
  padding: 0 14px;
  color: #7f8ea3;
  font-size: 12px;
  font-weight: 500;
}

/* Input groups */
.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-input-group label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-input-group input {
  padding: 13px 15px;
  background: rgba(7,11,20,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 11px;
  color: #e5e7eb;
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.auth-input-group input:hover {
  border-color: rgba(255,255,255,0.14);
}

.auth-input-group input:focus {
  border-color: rgba(230,57,70,0.55);
  background: rgba(7,11,20,0.85);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}

.auth-input-group input::placeholder {
  color: #4a5568;
}

.auth-hint {
  color: #7f8ea3;
  font-size: 12px;
  margin-top: -2px;
}

/* Error */
.auth-error {
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.25);
  color: #fca5a5;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Submit button */
.auth-submit-btn {
  padding: 14px 20px;
  background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s, filter 0.15s;
  box-shadow: 0 4px 18px rgba(230,57,70,0.38);
  margin-top: 4px;
  letter-spacing: 0.02em;
  font-family: inherit;
}

.auth-submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(230,57,70,0.52);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.96);
}

.auth-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-footer-text {
  text-align: center;
  color: #7f8ea3;
  font-size: 13.5px;
  margin-top: 18px;
}

.auth-link {
  background: transparent;
  border: none;
  color: #e63946;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  font-size: inherit;
  transition: opacity 0.15s;
  font-family: inherit;
}

.auth-link:hover { opacity: 0.8; }

/* =========================
   SUCCESS STATE
========================= */

.auth-success-container {
  text-align: center;
  padding: 20px 0;
}

.auth-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: rgba(230,57,70,0.12);
  border: 1.5px solid rgba(230,57,70,0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

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

.auth-success-icon svg { color: #e63946; }

.auth-success-container h2 {
  color: #e5e7eb;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.auth-success-container p {
  color: #7f8ea3;
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 640px) {
  .auth-modal-content {
    padding: 28px 22px 24px;
    border-radius: 18px;
  }

  .auth-form-container h2 {
    font-size: 20px;
  }

  .user-name {
    max-width: 80px;
  }
}

/* ── Custom Scrollbar (global) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── Custom Select / Dropdown ── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255,255,255,0.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8ea3' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #e5e7eb;
  padding: 8px 32px 8px 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

select:focus {
  border-color: rgba(230,57,70,0.5);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.08);
}

select:hover { border-color: rgba(255,255,255,0.16); }

select option {
  background: #111827;
  color: #e5e7eb;
  padding: 8px 12px;
}

select option:checked {
  background: linear-gradient(#e63946, #e63946);
  color: #fff;
}

/* ── Custom Select Dropdown Component ── */
.cs-wrap { position: relative; display: inline-block; }
.cs-wrap.cs-full { width: 100%; }

.cs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

.cs-trigger:hover { border-color: rgba(255,255,255,0.16); }

.cs-wrap.open .cs-trigger { border-color: #e63946; }

.cs-chevron {
  color: #7f8ea3;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}

.cs-wrap.open .cs-chevron { transform: rotate(180deg); }

.cs-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: linear-gradient(160deg, rgba(14,20,36,0.99) 0%, rgba(10,14,24,0.99) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 5px;
  z-index: 350;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}

.cs-wrap.open .cs-menu {
  display: block;
  animation: csDropdownIn 0.12s ease;
}

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

.cs-option {
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #7f8ea3;
  transition: background 0.1s, color 0.1s;
  user-select: none;
  white-space: nowrap;
}

.cs-option:hover { background: rgba(230,57,70,0.12); color: #e63946; }

.cs-option.selected {
  background: #e63946;
  color: #fff;
  font-weight: 600;
}

.cs-option.selected:hover { background: #c1121f; }
