:root {
  --bg: #0a1628;
  --bg-card: #111d33;
  --border: #1e3354;
  --text: #f5f7fb;
  --text-muted: #8b9cb8;
  --gold-start: #c9a962;
  --gold-end: #e8d5a3;
  --link: #7eb8ff;
  --error: #ff6b6b;
  --success: #5dd39e;
  --input-bg: #0d1a2d;
  --radius: 12px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

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

html, body {
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #132743 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 29, 51, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow);
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: block;
}

.brand h1 {
  font-size: 2rem;
  letter-spacing: 0.35em;
  font-weight: 800;
  margin-bottom: 8px;
}

.brand .tagline {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.field input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  padding: 14px 14px 14px 44px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--gold-start);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.15);
}

.field input.no-icon {
  padding-left: 14px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.inline-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 24px;
  font-size: 0.88rem;
}

.inline-links a {
  color: var(--link);
  text-decoration: none;
}

.inline-links a:hover {
  text-decoration: underline;
}

.inline-links .sep {
  color: var(--border);
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: #1a1208;
  background: linear-gradient(90deg, var(--gold-start), var(--gold-end));
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 13px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-oauth:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: #35527a;
}

.btn-oauth:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-oauth img,
.btn-oauth svg {
  width: 18px;
  height: 18px;
}

.legal {
  margin-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal a {
  color: var(--link);
  text-decoration: none;
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
}

.alert-success {
  background: rgba(93, 211, 158, 0.12);
  border: 1px solid rgba(93, 211, 158, 0.35);
  color: #b8f2d8;
}

.alert-info {
  background: rgba(126, 184, 255, 0.1);
  border: 1px solid rgba(126, 184, 255, 0.28);
  color: #cfe4ff;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--link);
  text-decoration: none;
  font-size: 0.88rem;
}

.back-link:hover {
  text-decoration: underline;
}

.wait-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(201, 169, 98, 0.12);
  border: 1px solid rgba(201, 169, 98, 0.35);
  font-size: 2rem;
}

.summary {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
}

.summary dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 10px;
}

.summary dt:first-child {
  margin-top: 0;
}

.summary dd {
  font-size: 0.95rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .card {
    padding: 32px 20px 24px;
  }

  .brand h1 {
    font-size: 1.65rem;
    letter-spacing: 0.25em;
  }
}
