/* =============================================
   Twilight Homes — Shared Styles
   ============================================= */

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

:root {
    --bg: #0c0a10;
    --surface: #120f18;
    --surface-raised: #1a1624;
    --text: #cdc9d8;
    --text-dim: #7a7387;
    --text-faded: #3d3848;
    --accent: #9b87c4;
    --accent-dim: rgba(155, 135, 196, 0.20);
    --border: #221e2c;
    --green: #4a7c59;
    --green-dim: rgba(74, 124, 89, 0.2);
    --warn-bg: #1a0a0a;
    --warn-border: #5a1a1a;
    --danger: #8b2020;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 80px 24px 120px;
}

.container {
    max-width: 780px;
    margin: 0 auto;
}

.container--wide {
    max-width: 1000px;
    margin: 0 auto;
}

/* --- NAV --- */

.back-link {
    display: inline-block;
    margin-bottom: 40px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}
.back-link:hover { color: var(--text); }

/* --- HEADER --- */

header {
    margin-bottom: 56px;
}

header.center {
    text-align: center;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.subtitle {
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-dim);
    max-width: 580px;
    line-height: 1.7;
}

header.center .subtitle { margin: 0 auto; }

.header-rule {
    width: 40px;
    height: 1px;
    background: var(--accent);
    opacity: 0.5;
    margin-top: 28px;
}

header.center .header-rule { margin: 28px auto 0; }

/* --- NOTICE BOX --- */

.notice {
    padding: 24px 28px;
    margin-bottom: 48px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text);
}

.notice--warn {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-left: 3px solid var(--danger);
}

.notice--info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green);
}

.notice__head {
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 0.65rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.notice--info .notice__head { color: var(--green); }
.notice--warn .notice__head { color: var(--danger); }

.notice p { margin-bottom: 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { font-weight: 700; }

/* --- TWO-COLUMN CHOICE --- */

.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 56px;
}

.choice-card {
    display: block;
    background: var(--surface);
    padding: 40px 36px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.choice-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.35s ease;
}

.choice-card:hover { background: var(--surface-raised); }
.choice-card:hover::after { transform: scaleY(1); }

.choice-card__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-faded);
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.choice-card:hover .choice-card__label { color: var(--accent); }

.choice-card__title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.2;
}

.choice-card__desc {
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* --- FORM --- */

.form-section {
    margin-bottom: 48px;
}

.form-section__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--text-faded);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.field {
    margin-bottom: 28px;
}

.field label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.field label .required {
    color: var(--accent);
    margin-left: 4px;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--text-faded);
}

.field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6860'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.field__hint {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-faded);
    margin-top: 6px;
    line-height: 1.5;
}

/* Checkboxes */
.check-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.check-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-top: 3px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.check-item input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.check-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.check-item__text {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.5;
}

.check-item__text strong {
    display: block;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 2px;
}

/* Radio */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.radio-item:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.radio-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.radio-item:has(input:checked) input[type="radio"] {
    border-color: var(--accent);
    background: var(--accent);
}

.radio-item__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-dim);
}

/* Number input */
.field input[type="number"] {
    width: 120px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.field input[type="number"]:focus { border-color: var(--text-faded); }
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Vetting questions */
.vetting-question {
    margin-bottom: 32px;
    padding: 24px 24px 24px 20px;
    border-left: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.vetting-question:focus-within { border-left-color: var(--accent); }

.vetting-question__q {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.6;
}

.vetting-question__q span {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faded);
    display: block;
    margin-bottom: 6px;
}

/* Submit */
.form-submit {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    padding: 14px 28px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover { background: #a02828; }
.btn--primary:disabled { background: var(--border); color: var(--text-faded); cursor: not-allowed; }

.btn--ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--text-dim); color: var(--text); }

.form-status {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-dim);
}

.form-status--error { color: #c04040; }
.form-status--ok    { color: var(--green); }

/* Honeypot */
.hp-field { display: none !important; }

/* --- SUCCESS STATE --- */

.success-state {
    display: none;
    text-align: center;
    padding: 80px 0;
}

.success-state.active { display: block; }

.success-state__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 400;
    margin-bottom: 20px;
}

.success-state__body {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- FOOTER --- */

footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faded);
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

footer a {
    color: var(--text-faded);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover { color: var(--text-dim); }

@media (max-width: 600px) {
    .choice-grid { grid-template-columns: 1fr; }
    .radio-group { flex-direction: column; }
    .form-submit { flex-direction: column; align-items: flex-start; }
    footer { flex-direction: column; gap: 16px; }
}

/* =============================================
   Alias / extended selectors to match templates
   ============================================= */

/* Fieldset reset */
fieldset { border: none; padding: 0; margin: 0; }
legend.form-section__title { padding: 0; }

/* form-section titles and hints */
.form-section__title {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--text-faded);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    width: 100%;
}
.form-section__hint {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--text-faded);
    margin-bottom: 16px;
    line-height: 1.5;
}
.form-section--inline { margin-bottom: 28px; }

/* Field sub-elements */
.field__label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.5;
}
.field__hint {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.73rem;
    font-weight: 300;
    color: var(--text-faded);
    margin-top: 4px;
    line-height: 1.5;
}
.field__input {
    display: block;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.field__input:focus { border-color: var(--text-faded); }
.field__input--short { width: 120px; }

.field__textarea {
    display: block;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 96px;
    line-height: 1.6;
}
.field__textarea:focus { border-color: var(--text-faded); }

.field__select {
    display: block;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 12px 36px 12px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6860'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.field__select:focus { border-color: var(--text-faded); }
.field__select option { background: var(--surface); color: var(--text); }
.field__select optgroup { color: var(--text-dim); font-weight: 700; }

/* Check item label alias */
.check-item__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Radio group row layout */
.radio-group--row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

/* Radio item label alias (already exists as .radio-item__label but ensure display) */
.radio-item__label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Required star */
.required-star { color: var(--accent); margin-left: 2px; }

/* Form actions (alias for form-submit) */
.form-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

/* btn--primary and btn--ghost as standalone (not requiring .btn base) */
.btn--primary {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease;
}
.btn--primary:hover { background: #a02828; }
.btn--primary:disabled { background: var(--border); color: var(--text-faded); cursor: not-allowed; }

.btn--ghost {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    text-decoration: none;
    display: inline-block;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.btn--ghost:hover { border-color: var(--text-dim); color: var(--text); }

/* Honeypot via class */
.hp-input { display: none !important; }

/* success-state inner elements */
.success-state h2 {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 400;
    margin-bottom: 24px;
}
.success-state p {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto 16px;
    line-height: 1.7;
}
.success-state a { margin-top: 32px; }

/* choice card sub-elements (alt names) */
.choice-card__icon {
    font-size: 0.6rem;
    color: var(--accent);
    opacity: 0.4;
    margin-bottom: 20px;
    display: block;
}
.choice-card__body {
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 24px;
}
.choice-card__cta {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faded);
    transition: color 0.3s ease;
}
.choice-card:hover .choice-card__cta { color: var(--accent); }

/* Notice links */
.notice a {
    color: var(--text-dim);
    word-break: break-all;
}
.notice a:hover { color: var(--text); }

/* footer as simple block when single paragraph context */
footer p { letter-spacing: 0; text-transform: none; font-size: 0.75rem; }

@media (max-width: 600px) {
    .form-actions { flex-direction: column; align-items: flex-start; }
}

/* Language toggle */
.lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 4px;
    z-index: 100;
}

.lang-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.lang-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.lang-btn:hover:not(.active) {
    border-color: var(--text-faded);
    color: var(--text);
}

/* ── Canary pulse ──────────────────────────────────────────── */
@keyframes canary-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}
#site-pulse {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 48px;
    height: auto;
    z-index: 100;
    pointer-events: none;
    animation: canary-pulse 2.4s ease-in-out infinite;
}
#site-pulse.pulse-dead {
    animation: none;
    transform: rotate(180deg);
    filter: brightness(0) saturate(100%) invert(17%) sepia(99%) saturate(3000%) hue-rotate(350deg);
}
