﻿@import url('/static/assets/fonts/fonts.css');

:root {
  /* Cosmic Luxury: warm amber + cool teal on deep ink */
  --ink-0: #050810;
  --ink-1: #0F172A;
  --text-0: rgba(255, 255, 255, 0.92);
  --text-1: rgba(255, 255, 255, 0.70);
  --text-2: rgba(255, 255, 255, 0.52);

  --amber-0: #FFD166;
  --amber-1: #D7A45B;
  --teal-0: #2DD4BF;
  --teal-1: #2CC7B5;

  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.18);
  --blur: 22px;

  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.55);
  --shadow-tight: 0 8px 22px rgba(0, 0, 0, 0.34);
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 60px rgba(45, 212, 191, 0.15);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text-0);
  background: 
    radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 0% 0%, rgba(255, 209, 102, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.8) 0%, transparent 60%),
    var(--ink-0);
  font-family: 'Noto Sans SC', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

.fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.radial-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0.64) 100%),
    radial-gradient(circle at 20% 10%, rgba(233, 194, 123, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(70, 230, 210, 0.08), transparent 42%);
}

.auth-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.2rem 1.2rem;
}

.auth-card {
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--glass-bg), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  padding: 3.5rem 3rem;
  overflow: hidden;
  transform-origin: 50% 40%;
  animation: liftIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(900px 400px at 20% -10%, rgba(233, 194, 123, 0.18), transparent 55%),
              radial-gradient(900px 420px at 90% 0%, rgba(70, 230, 210, 0.14), transparent 56%);
  opacity: 0.55;
  pointer-events: none;
  filter: blur(10px);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

@keyframes liftIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.3rem;
}

.auth-mark {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(233, 194, 123, 0.22), rgba(70, 230, 210, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-tight);
}

.auth-mark svg {
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.92);
}

.auth-title {
  font-family: 'Outfit', 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.9rem;
  margin: 0 0 0.25rem;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-1);
  font-size: 0.95rem;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin: 0.9rem 0 1.5rem;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--text-1);
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  z-index: 2;
  transition: color 180ms ease;
}

.auth-tab:hover {
  color: var(--text-0);
}

.auth-tab:focus-visible {
  outline: 2px solid rgba(70, 230, 210, 0.7);
  outline-offset: 2px;
}

.auth-tab-indicator {
  position: absolute;
  inset: 0.35rem;
  width: calc(50% - 0.175rem);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(233, 194, 123, 0.22), rgba(70, 230, 210, 0.14));
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 0 30px rgba(233, 194, 123, 0.10);
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 1;
}

.auth-tabs[data-active="register"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-panel {
  position: relative;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.form-label {
  color: var(--text-1);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 0.92rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(8, 12, 22, 0.42);
  color: var(--text-0);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.form-input:focus {
  border-color: rgba(70, 230, 210, 0.45);
  box-shadow: 0 0 0 3px rgba(70, 230, 210, 0.14);
  background: rgba(8, 12, 22, 0.55);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-internal-autofill-selected {
  background-color: rgba(8, 12, 22, 0.45) !important;
  -webkit-text-fill-color: var(--text-0);
  caret-color: var(--text-0);
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 12, 22, 0.45) inset;
  box-shadow: 0 0 0 1000px rgba(8, 12, 22, 0.45) inset;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 9999s ease-out;
}

.code-input-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.btn-send-code {
  padding: 0.92rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.20);
  color: var(--text-0);
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-1px);
}

.btn-send-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 0;
  cursor: pointer;
  color: rgba(9, 13, 24, 0.96);
  font-family: 'Outfit', 'Noto Sans SC', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--amber-0), var(--teal-0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 24px rgba(255, 209, 102, 0.2);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 120%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-15deg);
  transition: left 520ms ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46), 0 0 30px rgba(70, 230, 210, 0.14);
}

.btn-primary:hover:not(:disabled)::before {
  left: 120%;
}

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

.btn-primary:focus-visible,
.btn-send-code:focus-visible {
  outline: 2px solid rgba(233, 194, 123, 0.75);
  outline-offset: 2px;
}

.turnstile-container {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0 0.1rem;
}

.status-message {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-0);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  animation: fadeIn 180ms ease;
}

.status-message.success {
  border-color: rgba(70, 230, 210, 0.28);
  background: rgba(70, 230, 210, 0.10);
}

.status-message.error {
  border-color: rgba(255, 120, 120, 0.34);
  background: rgba(255, 120, 120, 0.10);
}

.status-message.info {
  border-color: rgba(233, 194, 123, 0.30);
  background: rgba(233, 194, 123, 0.10);
}

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

.auth-footer {
  margin-top: 0.6rem;
  text-align: center;
  color: var(--text-1);
  font-size: 0.92rem;
}

.auth-footer a {
  color: rgba(70, 230, 210, 0.92);
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.auth-footer a:hover {
  color: rgba(233, 194, 123, 0.95);
  text-decoration: underline;
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.90);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

@media (max-width: 640px) {
  .auth-card {
    padding: 2.0rem 1.35rem 1.7rem;
    border-radius: 22px;
  }
  .auth-header {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .code-input-group {
    grid-template-columns: 1fr;
  }
  .btn-send-code {
    width: 100%;
  }
}

