@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #171320;
  --panel: #211C2E;
  --panel-raised: #2A2438;
  --ink: #F3EFE7;
  --ink-dim: #9C93AC;
  --ink-faint: #6A6280;
  --brass: #C9A227;
  --brass-dim: #8A701C;
  --brass-ink: #241C05;
  --line: rgba(243, 239, 231, 0.09);
  --line-strong: rgba(243, 239, 231, 0.18);
  --error: #E2574C;
  --error-bg: rgba(226, 87, 76, 0.12);
  --radius: 4px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
}

a { color: var(--brass); }

.shell {
  display: flex;
  flex-direction: column;
}

.brand-side { min-height: auto; padding: 2rem 1.25rem 1.5rem !important; }
.card-side { padding: 0.5rem 1.25rem 2.5rem !important; }
.brand-wordmark { font-size: 2.1rem !important; }
.brand-tagline { font-size: 14px !important; }
.brand-side.compact {
  padding: 0.4rem 1.25rem 0.15rem !important;
  align-items: center;
  text-align: center;
}

.brand-side.compact .brand-wordmark { transform: translateY(0.18em); }
.card-side.tight { padding-bottom: 1rem !important; }

/* ---------- left: brand side ---------- */

.brand-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.brand-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.18);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.02;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 34ch;
  margin: 0;
}

.brand-meta {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.brand-meta strong {
  display: block;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- right: access card ---------- */

.card-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 2.25rem 2rem 2rem;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: var(--bg);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.card::after {
  content: '';
  position: absolute;
  top: 22px;
  right: 0;
  width: 22px;
  height: 1px;
  background: var(--line-strong);
  transform: rotate(-45deg);
  transform-origin: top right;
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.4rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  margin: 0 0 1.75rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}

.field input {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 0.7rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input::placeholder { color: var(--ink-faint); }

.field input:focus {
  border-color: var(--brass);
}

.field-error {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 0.35rem;
}

.field-error.visible { display: block; }

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.6rem;
}

.eye-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 2.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.eye-toggle:hover { color: var(--ink-dim); }
.eye-toggle svg { width: 19px; height: 19px; }

.btn-primary {
  width: 100%;
  background: var(--brass);
  color: var(--brass-ink);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 0.8rem;
  cursor: pointer;
  margin-top: 0.4rem;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover { background: #DDB531; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1.25rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.oauth-row {
  display: flex;
  gap: 0.6rem;
}

.btn-oauth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn-oauth:hover {
  border-color: var(--line-strong);
  background: #322B44;
}

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

.btn-oauth:disabled:hover {
  background: var(--panel-raised);
}

.card-footer {
  margin-top: 1.75rem;
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
}

.card-footer a { text-decoration: none; font-weight: 500; }
.card-footer a:hover { text-decoration: underline; }

.alert {
  display: none;
  background: var(--error-bg);
  border: 1px solid rgba(226,87,76,0.35);
  color: var(--error);
  border-radius: var(--radius);
  font-size: 13px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 1.1rem;
}

.alert.visible { display: block; }

.status-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-line .pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5DCAA5;
}

/* ---------- landing ---------- */

.landing {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem 2rem;
}

.landing-hero {
  text-align: center;
  padding: 0.5rem 0 1.25rem;
}

.landing-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.4rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.landing-tagline {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 32ch;
  margin: 0 auto;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
}

.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 0.8rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-secondary:hover { border-color: var(--ink-dim); background: var(--panel-raised); }

.landing-actions .btn-primary { text-align: center; text-decoration: none; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 420px;
  width: 100%;
  margin: 1.75rem auto 0;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.feature-card h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.feature-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
}

/* ---------- success modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 15, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
  animation: modal-fade-in 0.18s ease;
}

.modal-overlay[hidden] { display: none; }

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  animation: modal-pop-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: rgba(93, 202, 165, 0.14);
  border: 1px solid rgba(93, 202, 165, 0.4);
  color: #5DCAA5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.modal-text {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 0 0 1rem;
}

.modal-creds {
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.modal-cred-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.modal-cred-row + .modal-cred-row {
  border-top: 1px solid var(--line);
}

.modal-cred-label {
  font-size: 12px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.modal-cred-value {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
  text-align: right;
}

.modal-warning {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--brass);
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  margin: 0 0 1.4rem;
  text-align: left;
}

.modal .btn-primary { margin-top: 0; }
