/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #0f0f0f;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-border-focus: #0f0f0f;
  --color-error: #dc2626;
  --color-btn: #0f0f0f;
  --color-btn-hover: #1f1f1f;
  --color-success: #16a34a;
  --radius: 10px;
  --radius-btn: 8px;
  --transition: 180ms ease;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  min-height: 100vh;
}

/* ── Page Layout ── */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 80px;
  min-height: 100vh;
}

/* ── Logo ── */
.logo-wrap {
  margin-bottom: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.logo-scale {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f0f0f;
}

.logo-sci-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f0f0f;
  border-radius: 10px;
  padding: 6px 14px;
  margin-left: 6px;
}

.logo-sci {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

/* ── Form Section ── */
.form-section {
  width: 100%;
  max-width: 480px;
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

/* ── Form Header ── */
.form-header {
  margin-bottom: 36px;
}

.form-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.form-header p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.5;
}

/* ── Field Groups ── */
.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  position: relative;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input::placeholder {
  color: #c0c4cc;
}

input:hover {
  border-color: #d1d5db;
}

input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(15, 15, 15, 0.07);
}

/* ── Validation States ── */
.error-msg {
  display: none;
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: 6px;
}

.field-group.invalid input {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.field-group.invalid .error-msg {
  display: block;
}

/* ── CTA ── */
.cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
}

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  color: #ffffff;
  background: var(--color-btn);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  background: var(--color-btn-hover);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.cta-subtext {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.submit-error {
  display: none;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--color-error);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Success State ── */
.success-state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0 8px;
}

.success-state.visible {
  display: flex;
}

.success-icon {
  width: 52px;
  height: 52px;
  color: var(--color-success);
  margin-bottom: 20px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.success-state h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.success-state p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 280px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .form-card {
    padding: 36px 24px;
    border-radius: 12px;
  }

  .form-header h1 {
    font-size: 1.375rem;
  }

  .page {
    padding: 36px 16px 60px;
  }

  .logo-wrap {
    margin-bottom: 36px;
  }
}
