/*
 * Нумерология — стили. Все правила ограничены контейнером .numerology-app,
 * чтобы не конфликтовать со стилями сайта и других сервисов.
 */

.numerology-app {
  --nm-bg: #0a090d;
  --nm-gold: #c9a961;
  --nm-gold-hi: #e6cf94;
  --nm-gold-lo: #8e7136;
  --nm-line: rgba(201, 169, 97, .28);
  --nm-line-soft: rgba(201, 169, 97, .14);
  --nm-text: #ece6d9;
  --nm-text-2: #cfc8d8;
  --nm-muted: #a39cae;
  --nm-focus: #f0d999;
  --nm-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --nm-sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --nm-ease: cubic-bezier(.22, .7, .2, 1);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--nm-text);
  font-family: var(--nm-sans);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(800px 480px at 50% -4%, rgba(230, 207, 148, .13), transparent 60%),
    radial-gradient(1200px 700px at 50% 0%, rgba(84, 56, 120, .30), transparent 65%),
    radial-gradient(900px 700px at 0% 70%, rgba(40, 28, 70, .32), transparent 60%),
    linear-gradient(180deg, var(--nm-bg) 0%, #100c18 45%, var(--nm-bg) 100%);
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 80px);
  -webkit-font-smoothing: antialiased;
}
.numerology-app *, .numerology-app *::before, .numerology-app *::after { box-sizing: border-box; }
.numerology-app [hidden] { display: none !important; }
.numerology-app img { max-width: 100%; display: block; }
.numerology-app button { font: inherit; color: inherit; }
.numerology-app :focus-visible { outline: 2px solid var(--nm-focus); outline-offset: 3px; }
:where(.numerology-app) p { margin: 0 0 12px; }
.numerology-page { margin: 0; background: #0a090d; }

/* Фон: звёзды и орнамент */
.nm-sky {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 14% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 10%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 46%, #e6cf9480 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 52%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 24% 76%, #e6cf9466 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 86%, #fff5 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 6% 94%, #fff4 50%, transparent 51%);
  background-size: 380px 380px;
}
.nm-orn {
  position: absolute; z-index: -1; pointer-events: none; opacity: .08;
  width: min(560px, 80vw); aspect-ratio: 1;
  background: url("../images/ornament.svg") center / contain no-repeat;
}
.nm-orn--tr { top: -150px; right: -170px; }
.nm-orn--bl { bottom: -170px; left: -190px; width: min(500px, 75vw); }

/* ---------- Типографика ---------- */
.nm-hero { text-align: center; max-width: 800px; margin: 0 auto clamp(26px, 5vw, 44px); }
.nm-hero__emblem { width: 240px; height: 120px; max-width: 80%; margin: 0 auto 10px; filter: drop-shadow(0 0 14px rgba(230, 200, 130, .35)); }
.nm-hero__title {
  font-family: var(--nm-serif); font-weight: 600; letter-spacing: .02em;
  font-size: clamp(40px, 7vw, 68px); line-height: 1.05; margin: 0 0 14px;
  background: linear-gradient(180deg, #f3e3b6 0%, var(--nm-gold) 70%, #a88848 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nm-hero__lead { color: var(--nm-muted); font-size: clamp(16px, 2.2vw, 19px); margin: 0 auto !important; max-width: 640px; text-wrap: balance; }

.nm-h2 { font-family: var(--nm-serif); font-weight: 600; color: var(--nm-gold-hi); font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; margin: 0 0 16px; }
.nm-h3 { font-family: var(--nm-serif); font-weight: 600; color: var(--nm-gold-hi); font-size: clamp(21px, 2.6vw, 25px); line-height: 1.2; margin: 0 0 8px; }
.nm-muted { color: var(--nm-muted); font-size: 14px; }
.nm-hint { color: var(--nm-muted); font-size: 13.5px; }
.nm-label { margin: 0 0 4px !important; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--nm-gold); }

/* ---------- Панели ---------- */
.nm-panel {
  position: relative; max-width: 1040px; margin: 0 auto clamp(24px, 4vw, 40px);
  padding: clamp(22px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(30, 28, 34, .78), rgba(18, 16, 22, .82));
  border: 1px solid rgba(201, 169, 97, .2); border-radius: 22px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.nm-panel::before { content: ''; position: absolute; inset: 7px; border: 1px solid var(--nm-line-soft); border-radius: 16px; pointer-events: none; }
.nm-panel > * { position: relative; }

/* ---------- Кнопки и поля ---------- */
.nm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--nm-line); background: rgba(10, 9, 14, .5); color: var(--nm-text) !important;
  font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.2;
  transition: border-color .2s, background .2s, box-shadow .25s, transform .2s var(--nm-ease);
}
.nm-btn:hover { border-color: var(--nm-gold); background: rgba(201, 169, 97, .08); }
.nm-btn:active { transform: translateY(1px); }
.nm-btn--primary {
  color: #1a1408 !important; border-color: transparent;
  background: linear-gradient(180deg, #ecd79f 0%, #c9a961 55%, #a98a48 100%);
  box-shadow: 0 10px 30px -12px rgba(201, 169, 97, .6), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.nm-btn--primary:hover { background: linear-gradient(180deg, #f3e2b2 0%, #d4b56d 55%, #b39350 100%); }
.nm-btn--lg { min-height: 54px; padding: 14px 34px; font-size: 16px; }
.numerology-app .nm-btn:focus-visible { outline-offset: 4px; }

.nm-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 10px 16px; border-radius: 10px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--nm-line-soft); background: rgba(8, 7, 12, .65); color: var(--nm-text);
}
.nm-input:focus { outline: none; border-color: var(--nm-gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, .2); }
.nm-input::placeholder { color: #756f80; }

.nm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 0; }
.nm-share { max-width: 620px; margin: 14px auto 0; }
.nm-share__label { color: var(--nm-muted); font-size: 13.5px; }
.nm-share__row { display: flex; gap: 8px; margin-top: 6px; }

/* ---------- 1. Форма ---------- */
.nm-setup { max-width: 760px; }
.nm-setup > .nm-h2 { text-align: center; }
.nm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 24px); }
.nm-field { display: block; min-width: 0; }
.nm-field__label { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--nm-text-2); margin-bottom: 8px; }
.nm-step { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--nm-line); border-radius: 50%; font-family: var(--nm-serif); font-size: 14px; color: var(--nm-gold); }
.nm-fields .nm-input { width: 100%; min-height: 52px; color-scheme: dark; font-size: 16px; }
.nm-error { margin: 16px 0 0 !important; padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(230, 120, 110, .45); background: rgba(230, 120, 110, .08); color: #f1b7ae; font-size: 14.5px; text-align: center; }
.nm-setup__footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--nm-line-soft); }
.nm-setup__footer .nm-hint { margin: 0 !important; max-width: 380px; }

/* ---------- 2. Результат ---------- */
.nm-result { animation: nm-rise .8s var(--nm-ease) both; }
@keyframes nm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.nm-main { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; max-width: 860px; margin: 0 auto; }
.nm-medal { position: relative; width: 200px; height: 200px; color: var(--nm-gold); }
.nm-medal::before { content: ''; position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 207, 148, .2), transparent 70%); }
.nm-medal__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: nm-spin 60s linear infinite; }
@keyframes nm-spin { to { transform: rotate(360deg); } }
.nm-medal__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--nm-serif); font-weight: 600; font-size: 96px; line-height: 1;
  background: linear-gradient(180deg, #f6e8c0 0%, var(--nm-gold) 70%, #a88848 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(230, 200, 130, .25);
  font-variant-numeric: lining-nums;
}
.nm-main__title { font-family: var(--nm-serif); font-size: clamp(42px, 6vw, 62px); font-weight: 600; color: var(--nm-gold-hi); margin: 0 0 6px; line-height: 1.05; outline: none; }
.numerology-app .nm-main__title:focus, .numerology-app .nm-main__title:focus-visible { outline: none; }
.nm-master { display: inline-block; margin: 0 0 10px !important; padding: 3px 14px; border-radius: 999px; border: 1px solid var(--nm-line); color: var(--nm-gold-hi); font-size: 13px; letter-spacing: .04em; }
.nm-keywords { list-style: none; margin: 4px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nm-keywords li { padding: 4px 14px; border-radius: 999px; background: rgba(201, 169, 97, .1); border: 1px solid var(--nm-line-soft); color: var(--nm-text); font-size: 14px; }
.nm-calc { margin: 0 !important; color: var(--nm-muted); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nm-calc__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--nm-gold); margin-right: 6px; }

.nm-essence { max-width: 860px; margin: 28px auto 0 !important; padding-top: 24px; border-top: 1px solid var(--nm-line-soft); color: var(--nm-text-2); font-size: 17px; line-height: 1.7; }

.nm-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.nm-card { padding: 20px 22px; border-radius: 16px; border: 1px solid var(--nm-line-soft); background: rgba(10, 9, 14, .5); min-width: 0; }
.nm-card__kicker { margin: 0 0 8px !important; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--nm-gold); }
.nm-card__title { font-family: var(--nm-serif); font-size: clamp(22px, 2.6vw, 26px); font-weight: 600; color: var(--nm-gold-hi); margin: 0 0 8px; line-height: 1.15; }
.nm-card p { color: var(--nm-text-2); font-size: 15px; }
.nm-card p:last-child { margin-bottom: 0; }
.nm-card__list { margin: 0; padding: 0 0 0 18px; color: var(--nm-text-2); font-size: 15px; }
.nm-card__list li { margin-bottom: 6px; }
.nm-card__list li::marker { color: var(--nm-gold); }

.nm-advice { margin: 26px auto 0; max-width: 760px; text-align: center; padding: 22px 24px; border-radius: 16px; border: 1px solid var(--nm-line); background: radial-gradient(500px 160px at 50% 0, rgba(201, 169, 97, .12), transparent 70%), rgba(10, 9, 14, .5); }
.nm-advice__label { display: block; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--nm-gold); margin-bottom: 6px; }
.nm-advice p { margin: 0 !important; font-family: var(--nm-serif); font-style: italic; font-size: clamp(21px, 2.8vw, 26px); line-height: 1.3; color: var(--nm-gold-hi); }

.nm-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; align-items: start; }
.nm-card--num { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; }
.nm-card__badge {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--nm-line); background: radial-gradient(circle, rgba(230, 207, 148, .16), transparent 70%);
  font-family: var(--nm-serif); font-size: 32px; font-weight: 600; color: var(--nm-gold-hi); line-height: 1;
  font-variant-numeric: lining-nums;
}
.nm-card .nm-card__focus { color: var(--nm-text); font-size: 14.5px; }
.nm-card__focus b { color: var(--nm-gold-hi); font-weight: 600; }
.nm-card .nm-card__calc { color: var(--nm-muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nm-card .nm-card__next { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--nm-line-soft); color: var(--nm-muted); font-size: 14px; }

.nm-disclaimer { font-size: 13px; color: var(--nm-muted); margin: 22px auto 0 !important; max-width: 760px; text-align: center; }

.nm-consult {
  text-align: center; margin: 34px auto 0; max-width: 760px; padding: clamp(24px, 4vw, 40px);
  border-radius: 18px; border: 1px solid var(--nm-line); position: relative; overflow: hidden;
  background: radial-gradient(600px 220px at 50% 0, rgba(201, 169, 97, .12), transparent 70%), rgba(10, 9, 14, .5);
}
.nm-consult__ornament { color: var(--nm-gold); font-size: 20px; }
.nm-consult .nm-h3 { margin-top: 6px; font-size: clamp(24px, 3.2vw, 30px); }
.nm-consult p { color: var(--nm-muted); max-width: 560px; margin: 0 auto 22px; }

/* ---------- Информация ---------- */
.nm-info__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin-bottom: 22px; }
.nm-info p { color: var(--nm-text-2); }
.nm-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.nm-steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; color: var(--nm-text-2); }
.nm-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--nm-line); border-radius: 50%; font-family: var(--nm-serif); color: var(--nm-gold); font-size: 17px; }
.nm-steps b { color: var(--nm-text); }

.nm-numbers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nm-numbers li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--nm-line-soft); background: rgba(10, 9, 14, .4); }
.nm-numbers b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--nm-line); font-family: var(--nm-serif); font-size: 22px; font-weight: 600; color: var(--nm-gold-hi); font-variant-numeric: lining-nums; }
.nm-steps li::before { font-variant-numeric: lining-nums; }
.nm-numbers span { color: var(--nm-text-2); font-size: 14px; line-height: 1.45; }
.nm-numbers strong { color: var(--nm-text); font-weight: 600; }

.nm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; padding: 12px 20px; border-radius: 999px; background: #1d1729; border: 1px solid var(--nm-gold); color: var(--nm-gold-hi); font-size: 14.5px; box-shadow: 0 20px 50px -20px #000; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .nm-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nm-extra { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nm-hero__emblem { width: 200px; height: 100px; }
  .nm-fields { grid-template-columns: 1fr; }
  .nm-setup__footer { flex-direction: column; align-items: stretch; }
  .nm-setup__footer .nm-hint { text-align: center; max-width: none; }
  .nm-main { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .nm-medal { width: 170px; height: 170px; }
  .nm-medal__num { font-size: 80px; }
  .nm-keywords { justify-content: center; }
  .nm-details, .nm-info__grid, .nm-numbers { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .nm-actions .nm-btn, .nm-setup__footer .nm-btn { width: 100%; }
  .nm-card--num { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .numerology-app *, .numerology-app *::before, .numerology-app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
