:root {
    --ink: #1c2230;
    --ink-soft: #5a6172;
    --bg: #f6f2ea;
    --card: #ffffff;
    --line: #e4ddd0;
    --accent: #9a7b4f;
    --accent-dark: #7d6340;
    --deep: #1f2a3a;
    --error: #b3261e;
    --ok: #2e7d4f;
    --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.topbar { background: var(--deep); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { color: #fff; text-decoration: none; font-family: "Cormorant Garamond", Georgia, serif; font-size: 26px; font-weight: 600; letter-spacing: .5px; }
.brand img { max-height: 44px; display: block; }
.back-link { color: #d8c7a6; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #fff; }

.layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; padding-top: 56px; padding-bottom: 64px; align-items: start; }

.intro { position: sticky; top: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 12px; color: var(--accent); font-weight: 600; margin: 0 0 12px; }
h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 54px; line-height: 1.05; margin: 0 0 20px; color: var(--deep); }
.lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 32px; max-width: 460px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li span { flex: 0 0 34px; height: 34px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
.steps strong { display: block; color: var(--deep); }
.steps div { color: var(--ink-soft); font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 18px 50px -20px rgba(31, 42, 58, .25); padding: 36px; border: 1px solid var(--line); }

fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
legend { font-family: "Cormorant Garamond", Georgia, serif; font-size: 24px; font-weight: 600; color: var(--deep); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; padding: 0; }
legend .num { font-family: Inter, sans-serif; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--deep); color: #fff; display: inline-grid; place-items: center; }

.row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password] {
    width: 100%; height: 46px; padding: 0 14px; font: inherit; color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; background: #fcfbf8; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 123, 79, .15); background: #fff; }
.phone { display: flex; }
.phone span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: #f1ece2; color: var(--ink-soft); font-size: 14px; }
.phone input { border-radius: 0 10px 10px 0; min-width: 0; flex: 1; }

.has-error input { border-color: var(--error); }
.error-text { display: block; color: var(--error); font-size: 12.5px; margin-top: 5px; }

.ref-row { display: grid; grid-template-columns: 30px minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: start; padding-top: 4px; border-top: 1px dashed var(--line); padding-top: 14px; }
.ref-row:first-of-type { border-top: 0; padding-top: 0; }
.ref-index { margin-top: 32px; width: 26px; height: 26px; border-radius: 50%; background: #f1ece2; color: var(--accent-dark); font-weight: 600; font-size: 13px; display: grid; place-items: center; }

.consent { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-soft); margin: 0 0 6px; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.consent.has-error span { color: var(--error); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 15px 28px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .65; cursor: wait; }
.btn-block { width: 100%; margin-top: 18px; }
.btn-ghost { background: transparent; border: 1px solid var(--accent); color: var(--accent-dark); border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }

.alert { background: #fbeceb; color: var(--error); border: 1px solid #f1c7c4; padding: 12px 14px; border-radius: 10px; margin-bottom: 22px; font-size: 14px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.success { text-align: center; padding: 24px 8px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: #e7f3ec; color: var(--ok); font-size: 30px; display: grid; place-items: center; margin: 0 auto 18px; }
.success h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; margin: 0 0 8px; color: var(--deep); }
.success p { color: var(--ink-soft); }
.ref-id { display: inline-flex; align-items: center; gap: 14px; background: #f6f2ea; border: 1px dashed var(--accent); border-radius: 12px; padding: 14px 18px; margin: 10px 0 18px; }
.ref-id code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: 2px; color: var(--deep); }
.muted { font-size: 13.5px; max-width: 420px; margin: 0 auto 24px; }

.footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; padding: 22px 0; }

@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0,1fr); gap: 32px; padding-top: 32px; }
    .intro { position: static; }
    h1 { font-size: 40px; }
    .steps { display: none; }
}
@media (max-width: 560px) {
    .wrap { padding-left: 16px; padding-right: 16px; }
    .card { padding: 22px 18px; }
    .row { grid-template-columns: 1fr; gap: 0; }
    .ref-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
    .ref-index { display: none; }
    .back-link { display: none; }
    .ref-id code { font-size: 21px; }
}

.ref-badge { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--deep); color: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 26px; }
.ref-badge-label { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #d8c7a6; }
.ref-badge code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.ref-badge-note { font-size: 12.5px; color: #c4cad6; max-width: 210px; }

.ref-badge-id { display: flex; align-items: center; gap: 14px; }
.btn-copy { background: transparent; color: #fff; border: 1px solid #d8c7a6; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-copy:hover { background: rgba(216, 199, 166, .15); }
.btn-copy.is-copied, .btn-ghost.is-copied { border-color: var(--ok); color: #fff; background: var(--ok); }
.btn.is-copied { background: var(--ok); }

.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 26, 36, .6); }
.modal.is-open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 420px; padding: 30px 26px 20px; text-align: center; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: pop .2s ease-out; }
.modal-icon { font-size: 34px; margin-bottom: 6px; }
.modal-box h3 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 28px; color: var(--deep); margin: 0 0 8px; }
.modal-box p { color: var(--ink-soft); margin: 0 0 6px; font-size: 14.5px; }
.modal-box .btn-block { margin-top: 4px; }
.modal-close { background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: 14px; margin-top: 12px; padding: 6px 10px; cursor: pointer; text-decoration: underline; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
