:root {
  --brand: #8b5cf6;
  --brand-light: #c084fc;
  --bg: #0b1020;
  --bg-2: #0e1430;
  --card: rgba(20, 27, 56, 0.55);
  --border: rgba(139, 92, 246, 0.25);
  --text: #f0f2f9;
  --muted: #b8bfd9;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 16px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  background-image:
    radial-gradient(60vw 60vw at 80% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(50vw 50vw at -10% 110%, rgba(192, 132, 252, 0.12), transparent 60%);
  background-attachment: fixed;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }

header.brand { text-align: center; margin-bottom: 8px; }
header.brand img { width: 170px; max-width: 60%; opacity: 0.95; }

.hero { text-align: center; margin: 28px 0 36px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); margin-top: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.06);
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--text);
  background: rgba(8, 12, 28, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: #6b7494; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
.field input.error { border-color: var(--err); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 38px rgba(139, 92, 246, 0.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.err-msg { color: var(--err); font-size: 14px; margin-top: 10px; min-height: 18px; }
.fineprint { color: #6b7494; font-size: 12px; margin-top: 14px; text-align: center; }

.hidden { display: none !important; }

/* Loading */
.loading { text-align: center; padding: 14px 0; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .status { color: var(--muted); font-size: 15px; min-height: 22px; }

/* Result */
.score-wrap { text-align: center; margin-bottom: 22px; }
.score {
  font-size: 54px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.score-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.summary { color: var(--text); text-align: center; margin: 6px auto 4px; max-width: 90%; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-light); margin: 26px 0 12px; font-weight: 700; }

.common { display: flex; flex-direction: column; gap: 10px; }
.common-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px;
  background: rgba(8, 12, 28, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: capitalize; }
.chip.strong { background: rgba(52, 211, 153, 0.18); color: var(--ok); }
.chip.medium { background: rgba(251, 191, 36, 0.18); color: var(--warn); }
.chip.weak { background: rgba(184, 191, 217, 0.15); color: var(--muted); }
.common-item .body { flex: 1; }
.common-item .label { font-weight: 600; }
.common-item .detail { color: var(--muted); font-size: 14px; margin-top: 2px; }
.common-item .type-ico { font-size: 18px; line-height: 1.3; }

.email-box { background: rgba(8, 12, 28, 0.6); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.email-box .subj { font-weight: 700; margin-bottom: 10px; }
.email-box .subj span { color: var(--muted); font-weight: 600; }
.email-box .email-body { white-space: pre-wrap; color: var(--text); font-size: 15px; }
.copy-btn {
  margin-top: 14px; padding: 10px 16px; font-size: 14px; font-weight: 600;
  background: rgba(139, 92, 246, 0.15); color: var(--brand-light);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.copy-btn:hover { background: rgba(139, 92, 246, 0.28); }

.again { text-align: center; margin-top: 22px; }
.again a { color: var(--brand-light); text-decoration: none; font-weight: 600; cursor: pointer; }
.again a:hover { text-decoration: underline; }

.result-err { text-align: center; color: var(--muted); padding: 12px 0; }
.result-err .big { font-size: 40px; margin-bottom: 10px; }
