:root {
  --bg: #0f172a;
  --bg-deep: #0b1222;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --muted-dark: #94a3b8;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --cyan: #06b6d4;
  --green: #10b981;
  --danger: #ef4444;
  --border: #334155;
  --input: rgba(15, 23, 42, 0.65);
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -15%, rgba(99, 102, 241, 0.18), transparent 38%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header nav {
  max-width: 1400px;
  min-height: 86px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.7px;
  background: linear-gradient(135deg, #818cf8 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.logo-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 7px 22px rgba(99, 102, 241, 0.3);
  -webkit-text-fill-color: #fff;
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex: 1;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.header-login,
.header-register {
  text-decoration: none;
  padding: 0.72rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.header-login {
  color: var(--muted);
}

.header-register {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 5px 18px rgba(99, 102, 241, 0.28);
}

main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 86px - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  border: 1px solid #3b4b7c;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(30, 41, 79, 0.98), rgba(20, 29, 55, 0.98));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #06b6d4, transparent);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.28);
  margin-bottom: 1.2rem;
  font-size: 1.25rem;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.6px;
}

.auth-card .subtitle {
  margin: 0.55rem 0 1.6rem;
  color: var(--muted-dark);
  font-size: 0.9rem;
  line-height: 1.6;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  color: #dbe4f0;
  font-size: 0.82rem;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 0.95rem;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  background: var(--input);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder {
  color: #64748b;
}

.input-wrap input:focus {
  border-color: var(--primary-light);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.13);
}

.password-wrap input {
  padding-right: 3.2rem;
}

.pw-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1rem;
}

.pw-toggle:hover {
  color: #fff;
}

.btn-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 22px rgba(99, 102, 241, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.38);
  filter: brightness(1.05);
}

.msg,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.msg {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.notice {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
}

.hint {
  margin: 0.45rem 0 0;
  color: var(--muted-dark);
  font-size: 0.75rem;
}

.card-footer {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
  text-align: center;
  color: var(--muted-dark);
  font-size: 0.82rem;
}

.card-footer a {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: none;
}

.card-footer a:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 1.35rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
}

footer a {
  color: #94a3b8;
  text-decoration: none;
}

footer a:hover {
  color: #cbd5e1;
}

@media (max-width: 820px) {
  .site-header nav {
    padding: 0 1rem;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header nav {
    min-height: 70px;
  }

  .logo {
    font-size: 1.25rem;
  }

  .header-login,
  .header-register {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
  }

  main {
    padding: 3rem 1rem;
  }

  .auth-card {
    padding: 1.4rem;
    border-radius: 15px;
  }
}