/* ── Council Mailer v2 — Frontend Styles ── */

/* Honeypot — visually hidden from all users */
.nycm-hp,
.nycm-hp * {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.nycm-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: #1d2327;
    line-height: 1.5;
}

/* ── Typography ── */
.nycm-wrap .nycm-heading {
    font-size: 1.65em;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a3c5e;
}
.nycm-wrap .nycm-subheading {
    font-size: 1em;
    color: #555;
    margin: 0 0 26px;
    line-height: 1.6;
}

/* ── Fields ── */
.nycm-field {
    margin-bottom: 18px;
}
.nycm-field > label,
.nycm-personal-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 6px;
    color: #1d2327;
}
.nycm-req { color: #d63638; }

.nycm-field input[type="text"],
.nycm-field input[type="email"],
.nycm-field input[type="tel"],
.nycm-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #c3c4c7;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    color: #1d2327;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nycm-field input:focus,
.nycm-field textarea:focus {
    outline: none;
    border-color: #1a3c5e;
    box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.12);
}
.nycm-field textarea {
    resize: vertical;
    min-height: 110px;
}

/* ── Read-only pre-filled fields ── */
.nycm-readonly-field {
    background: #f6f7f7;
    border: 1.5px solid #dcdcde;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.95em;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
}
.nycm-prefilled-subject.nycm-readonly-field {
    font-weight: 600;
    color: #1d2327;
}
.nycm-prefilled-body.nycm-readonly-field {
    min-height: 120px;
    border-left: 3px solid #1a3c5e;
    border-radius: 0 6px 6px 0;
}
.nycm-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

/* ── Field hint ── */
.nycm-field-hint {
    font-size: 0.82em;
    color: #888;
    margin: 5px 0 0;
}

/* ── Two-column row ── */
.nycm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 480px) {
    .nycm-field-row { grid-template-columns: 1fr; }
}

/* ── Checkbox / terms ── */
.nycm-terms-field > label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}
.nycm-terms-field input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #1a3c5e;
}

/* ── Validation ── */
.nycm-invalid {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1) !important;
}
.nycm-error {
    color: #d63638;
    font-size: 0.85em;
    margin-top: 5px;
}

/* ── Buttons ── */
.nycm-btn {
    display: inline-block;
    padding: 13px 28px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
}
.nycm-btn:active { transform: translateY(1px); }

.nycm-btn-primary { background: #1a3c5e; color: #fff; }
.nycm-btn-primary:hover { background: #0f2743; color: #fff; }

.nycm-btn-secondary { background: #f0f0f1; color: #1d2327; }
.nycm-btn-secondary:hover { background: #dcdcde; }

.nycm-btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Loading ── */
.nycm-loading {
    text-align: center;
    padding: 64px 20px;
    color: #666;
}
.nycm-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7e9;
    border-top-color: #1a3c5e;
    border-radius: 50%;
    animation: nycm-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes nycm-spin { to { transform: rotate(360deg); } }

/* ── District Lookup: rep reveal box ── */
.nycm-rep-reveal {
    background: #f0f4f8;
    border-left: 4px solid #1a3c5e;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.nycm-rep-reveal-text {
    margin: 0;
    color: #1a3c5e;
    font-size: 1.02em;
    line-height: 1.5;
}

/* ── Confirmation ── */
.nycm-confirmation {
    text-align: center;
    padding: 56px 24px;
}
.nycm-check-circle {
    width: 68px;
    height: 68px;
    background: #00a32a;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    line-height: 68px;
    margin: 0 auto 22px;
    text-align: center;
}
.nycm-confirmation h3 {
    font-size: 1.6em;
    color: #1a3c5e;
    margin: 0 0 12px;
}
.nycm-confirmation p {
    font-size: 1.05em;
    color: #555;
    margin: 0 0 8px;
    line-height: 1.6;
}

/* ── Social sharing buttons ── */
.nycm-social-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.nycm-social-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.nycm-social-btn:hover { opacity: 0.88; }
.nycm-twitter-btn  { background: #000; color: #fff; }

/* ── Snail Mail — Letter Preview ── */
.nycm-letter-preview {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 36px 44px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.75;
    color: #1a1a1a;
    max-width: 600px;
}
.nycm-letter-from,
.nycm-letter-to         { white-space: pre-line; margin-bottom: 20px; }
.nycm-letter-date       { margin-bottom: 20px; }
.nycm-letter-salutation { margin-bottom: 16px; }
.nycm-letter-body p     { margin: 0 0 1em; }
.nycm-letter-body p:last-child { margin-bottom: 0; }
.nycm-letter-body-edit  {
    width: 100%;
    min-height: 160px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.75;
    color: #1a1a1a;
    border: 1px solid #c8d0d8;
    border-radius: 3px;
    padding: 8px 10px;
    resize: vertical;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.nycm-letter-body-edit:focus {
    outline: none;
    border-color: #1a3c5e;
    box-shadow: 0 0 0 2px rgba(26,60,94,0.12);
}
.nycm-letter-closing    { margin-top: 20px; }

/* ── Surrounding page text (above/below form, hidden after submission) ── */
.nycm-extra-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
.nycm-text-above { margin-bottom: 20px; }
.nycm-text-below { margin-top: 20px; }
