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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-input: #1c1c28;
  --border: rgba(255, 255, 255, 0.06);
  --border-focus: #FF5C00;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  --accent: #FF5C00;
  --accent-hover: #FF7A2E;
  --accent-glow: rgba(255, 92, 0, 0.3);
  --accent-subtle: rgba(255, 92, 0, 0.08);
  --error: #ff4444;
  --error-bg: rgba(255, 68, 68, 0.1);
  --success: #44ff88;
  --success-bg: rgba(68, 255, 136, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 92, 0, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(255, 92, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  animation: navDrop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.nav-logo {
  font-size: 1.4rem; font-weight: 800; text-decoration: none; color: var(--text-primary);
  letter-spacing: -0.5px;
}
.nav-logo .accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none; font-size: 0.8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  transition: color var(--transition); position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--accent); transition: width var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }

/* ── AUTH CONTAINER ── */
.auth-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  padding: 40px 24px;
  animation: authReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* ── HEADER ── */
.auth-header { text-align: center; margin-bottom: 36px; }
.auth-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  animation: iconPulse 3s ease-in-out infinite;
}
.auth-title {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px;
  text-transform: uppercase; margin-bottom: 8px;
}
.auth-subtitle { color: var(--text-muted); font-size: 0.85rem; font-weight: 400; }

/* ── FORM ── */
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-muted);
}
.form-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  color: var(--text-primary); font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  transition: all var(--transition); outline: none;
}
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(255, 92, 0, 0.05);
}
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
}
.form-check {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}
.form-check label {
  font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; font-weight: 500;
}
.form-link {
  font-size: 0.8rem; color: var(--accent); text-decoration: none;
  font-weight: 600; transition: all var(--transition);
}
.form-link:hover { color: var(--accent-hover); text-shadow: 0 0 12px var(--accent-glow); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-sm); border: none;
  font-family: 'Montserrat', sans-serif; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent); color: white;
  box-shadow: inset 0 0 43px rgba(255,255,255,0.2), inset 0 -2px 13px rgba(255,255,255,0.25),
              0 0 33px var(--accent-glow), 0 4px 4px rgba(0,0,0,0.4);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: inset 0 0 43px rgba(255,255,255,0.5), inset 0 -2px 13px rgba(255,255,255,0.5),
              0 0 33px rgba(255,92,0,0.2);
  transform: translateY(-2px);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 42px rgba(255,255,255,0.05), inset 0 -2px 13px rgba(255,255,255,0.1);
}
.btn-secondary:hover {
  box-shadow: inset 0 0 43px rgba(255,255,255,0.1), inset 0 -2px 13px rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.15); color: var(--text-primary);
}

.btn-full { width: 100%; }

.btn-loader {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

/* ── MESSAGES ── */
.auth-message {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
  display: none; animation: msgSlide 0.3s ease;
}
.auth-message.error {
  display: block; background: var(--error-bg); color: var(--error);
  border: 1px solid rgba(255, 68, 68, 0.2);
}
.auth-message.success {
  display: block; background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(68, 255, 136, 0.2);
}

/* ── DIVIDER ── */
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 4px 0; color: var(--text-muted); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 2px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── FOOTER LINK ── */
.auth-footer {
  text-align: center; margin-top: 28px;
  font-size: 0.8rem; color: var(--text-muted); font-weight: 400;
}
.auth-footer a {
  color: var(--accent); text-decoration: none; font-weight: 600;
  transition: all var(--transition);
}
.auth-footer a:hover { color: var(--accent-hover); text-shadow: 0 0 12px var(--accent-glow); }

/* ── ACCOUNT PAGE ── */
.account-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px;
  padding: 40px 24px;
  animation: authReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  position: relative; overflow: hidden;
}
.account-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent-subtle); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 2rem;
}
.account-email {
  text-align: center; font-size: 1rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 4px;
}
.account-meta {
  text-align: center; font-size: 0.75rem; color: var(--text-muted);
  margin-bottom: 32px;
}
.account-section {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  margin-bottom: 16px;
}
.account-section-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 12px;
}
.account-info {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.account-info:last-child { border-bottom: none; }
.account-info-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.account-info-value { font-size: 0.8rem; color: var(--text-primary); font-weight: 600; }

.account-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.account-actions .btn-secondary { flex: 1; }
.btn-danger {
  background: transparent; color: var(--error);
  border: 1px solid rgba(255, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--error-bg); border-color: rgba(255, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.1);
}

/* ── LOGOUT PAGE ── */
.logout-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  padding: 40px 24px;
  animation: authReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.logout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
}

/* ── ANIMATIONS ── */
@keyframes navDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes authReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes msgSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); filter: blur(4px); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-inner { height: 60px; }
  .nav-logo { font-size: 1.2rem; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.7rem; }
  .auth-wrapper, .account-wrapper, .logout-wrapper { padding: 30px 16px; }
  .auth-card, .account-card, .logout-card { padding: 36px 24px; }
  .auth-title { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 0.65rem; letter-spacing: 0.5px; }
  .auth-card, .account-card, .logout-card { padding: 28px 20px; }
  .auth-title { font-size: 1.1rem; }
  .btn { padding: 12px 20px; font-size: 0.75rem; }
}

/* ── AZURACRAFT CINEMATIC LOGIN ── */
.login-body {
  --login-accent: #8e9dff;
  --login-violet: #b392ff;
  --login-image: url('../banner.png'); /* Replace with /assets/login-anime.webp when available. */
  min-height: 100svh;
  overflow: hidden;
  background: #070912;
  isolation: isolate;
}
.login-body::before { opacity: 0; }
.login-backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: #070912;
}
.login-backdrop-image {
  position: absolute; inset: -3%;
  background-image: var(--login-image);
  background-position: center 48%; background-size: cover;
  filter: saturate(.62) hue-rotate(178deg) brightness(.47) contrast(1.08);
  transform: translate3d(calc(var(--pointer-x, 0px) * -1), calc(var(--pointer-y, 0px) * -1), 0) scale(1.04);
  animation: loginImageDrift 34s ease-in-out infinite alternate;
  will-change: transform;
}
.login-backdrop-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5,7,17,.32), rgba(5,7,17,.66) 54%, rgba(5,7,17,.79)),
    linear-gradient(0deg, rgba(5,7,17,.66), transparent 48%, rgba(5,7,17,.38)),
    radial-gradient(ellipse at 27% 44%, rgba(87,104,255,.19), transparent 40%),
    radial-gradient(ellipse at 78% 18%, rgba(132,77,199,.14), transparent 36%);
}
.login-stars {
  position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(1px 1px at 12% 24%, #d8dcff 60%, transparent), radial-gradient(1px 1px at 68% 17%, #bbcaff 60%, transparent), radial-gradient(1.5px 1.5px at 81% 63%, #d5caff 60%, transparent), radial-gradient(1px 1px at 38% 79%, #c0d5ff 60%, transparent), radial-gradient(1px 1px at 92% 34%, #fff 60%, transparent);
  background-size: 390px 310px; animation: loginParticles 22s linear infinite;
}
.login-orbit { position: absolute; border: 1px solid rgba(174,181,255,.1); border-radius: 50%; filter: blur(.2px); }
.login-orbit-one { width: 46vw; height: 46vw; left: 7vw; top: 13vh; box-shadow: 0 0 80px rgba(98,117,255,.06); }
.login-orbit-two { width: 31vw; height: 31vw; left: 15vw; top: 23vh; border-color: rgba(190,163,255,.08); }
.auth-wrapper {
  width: min(100%, 470px); max-width: none; padding: 24px;
  animation: loginReveal .9s cubic-bezier(.16,1,.3,1) .15s both;
}
.auth-card {
  padding: 38px 38px 30px; border-radius: 18px;
  background: rgba(5,7,15,.48); border: 1px solid rgba(195,202,255,.13);
  box-shadow: 0 28px 90px rgba(0,0,0,.42), 0 0 55px rgba(90,105,255,.08), inset 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.auth-card::before {
  top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(175,187,255,.55), rgba(195,160,255,.42), transparent);
  opacity: .72;
}
.auth-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(112deg, transparent 28%, rgba(184,196,255,.035) 48%, transparent 66%);
  transform: translateX(-110%); animation: loginSheen 9s ease-in-out 1.3s infinite;
}
.auth-header { margin-bottom: 28px; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; color: #f4f5ff; text-decoration: none; margin-bottom: 23px; }
.login-brand .auth-icon {
  width: 40px; height: 40px; margin: 0; border-radius: 12px; color: #e9edff;
  font: 700 1rem/1 Montserrat,sans-serif; background: linear-gradient(145deg,rgba(147,163,255,.24),rgba(156,120,224,.1));
  border: 1px solid rgba(185,194,255,.26); box-shadow: 0 0 26px rgba(112,128,255,.14);
}
.login-brand-name { font-size: .86rem; font-weight: 800; letter-spacing: .19em; }
.login-brand-name span { color: #aeb6ff; }
.login-eyebrow { color: #aeb7df; font-size: .61rem; font-weight: 700; letter-spacing: .23em; margin-bottom: 11px; }
.login-eyebrow span { display: inline-block; width: 5px; height: 5px; margin: 0 7px 1px 0; border-radius: 50%; background: #9fafff; box-shadow: 0 0 10px #8394ff; }
.auth-title { font-size: 1.68rem; letter-spacing: -.04em; text-transform: none; margin-bottom: 6px; }
.auth-subtitle { color: rgba(216,220,241,.6); font-size: .82rem; }
.auth-form { gap: 17px; }
.form-label { color: rgba(209,215,241,.74); font-size: .63rem; letter-spacing: .16em; }
.form-input {
  min-height: 48px; background: rgba(7,10,21,.49); border-color: rgba(194,203,255,.12);
  border-radius: 9px; font-size: .86rem; box-shadow: inset 0 1px rgba(255,255,255,.018);
}
.form-input:focus { border-color: rgba(153,169,255,.62); box-shadow: 0 0 0 3px rgba(119,137,255,.1), 0 0 22px rgba(113,128,255,.1); }
.form-row { gap: 12px; }
.form-check label, .form-link { font-size: .72rem; }
.form-check input[type="checkbox"] { accent-color: #929eff; }
.form-link, .auth-footer a { color: #b4bcff; }
.form-link:hover, .auth-footer a:hover { color: #e1e4ff; text-shadow: 0 0 14px rgba(151,165,255,.42); }
.btn-primary {
  min-height: 48px; margin-top: 3px; border: 1px solid rgba(203,210,255,.25); border-radius: 9px;
  color: #f6f7ff; background: linear-gradient(105deg, rgba(111,128,225,.48), rgba(130,105,194,.45));
  box-shadow: 0 7px 24px rgba(79,91,185,.16), inset 0 1px rgba(255,255,255,.12);
  font-size: .69rem; letter-spacing: .17em;
}
.btn-primary:hover { background: linear-gradient(105deg,rgba(126,143,239,.62),rgba(151,120,214,.57)); box-shadow: 0 9px 30px rgba(91,103,210,.24), inset 0 1px rgba(255,255,255,.18); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .8; }
.login-loading { align-items: center; justify-content: center; gap: 10px; color: #e3e7ff; font-size: .7rem; letter-spacing: .12em; vertical-align: middle; }
.login-loading .btn-loader { width: 15px; height: 15px; border-color: rgba(211,218,255,.2); border-top-color: #c4ccff; box-shadow: 0 0 10px rgba(158,173,255,.3); }
.auth-divider { margin: 3px 0; color: rgba(192,199,224,.45); }
.btn-secondary { min-height: 44px; border-color: rgba(194,203,255,.13); border-radius: 9px; color: rgba(228,231,247,.78); font-size: .65rem; box-shadow: none; }
.btn-secondary:hover { border-color: rgba(174,186,255,.34); box-shadow: 0 0 20px rgba(111,128,255,.08); }
.auth-footer { margin-top: 23px; font-size: .72rem; }
.auth-message.error, .auth-message.success { margin-bottom: 15px; }
@keyframes loginReveal { from { opacity: 0; transform: translate3d(0,18px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes loginImageDrift { from { transform: translate3d(calc(var(--pointer-x, 0px) * -1), calc(var(--pointer-y, 0px) * -1), 0) scale(1.04); } to { transform: translate3d(calc(var(--pointer-x, 0px) * -1.25), calc(var(--pointer-y, 0px) * -1.2), 0) scale(1.09); } }
@keyframes loginParticles { to { background-position: 0 310px; } }
@keyframes loginSheen { 0%, 72%, 100% { transform: translateX(-110%); } 84% { transform: translateX(110%); } }
@media (max-width: 600px) {
  .login-backdrop-image { background-position: 42% center; filter: saturate(.65) hue-rotate(178deg) brightness(.38) contrast(1.06); }
  .login-backdrop-shade { background: linear-gradient(90deg,rgba(5,7,17,.54),rgba(5,7,17,.78)), linear-gradient(0deg,rgba(5,7,17,.76),rgba(5,7,17,.3)); }
  .login-orbit-one { width: 105vw; height: 105vw; left: -20vw; top: 8vh; }
  .login-orbit-two { width: 75vw; height: 75vw; left: -5vw; top: 19vh; }
  .auth-wrapper { padding: 20px 16px; }
  .auth-card { padding: 29px 23px 23px; }
  .auth-header { margin-bottom: 23px; }
  .login-brand { margin-bottom: 20px; }
}
@media (max-width: 360px) { .auth-card { padding: 25px 18px 20px; } .form-row { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) {
  .login-backdrop-image, .login-stars, .auth-wrapper, .auth-card::after { animation: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
