/* =============================================
   UTOPIA — CONTACT US PAGE
   Public page. Reuses legal.css chrome (header / hero / footer)
   and styles.css variables. Mobile-first, light + dark aware.
   ============================================= */

/* contact.css only loads on contact.html, so a page-wide [hidden] rule is safe
   and guarantees our JS show/hide toggles beat the component display rules. */
[hidden] { display: none !important; }

.contact-page {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px max(48px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .contact-page { padding: 48px 32px 96px; }
}

/* ---- Card ---- */
.contact-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--legal-radius-card, 1.25rem);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
    .contact-card { padding: 28px; }
}

/* ---- Signed-in chip ---- */
.contact-signed-in {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}
.contact-signed-in .material-symbols-outlined { color: var(--blue-500); font-size: 20px; flex-shrink: 0; }
.contact-signed-in strong { color: var(--text-primary); }

/* ---- Layout ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 560px) {
    .contact-grid { grid-template-columns: 1fr 1fr; }
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.contact-field label {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.contact-optional {
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ---- Inputs ---- */
.contact-field input,
.contact-field textarea,
.contact-select-wrap select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.contact-field input::placeholder,
.contact-field textarea::placeholder { color: var(--text-tertiary); }
.contact-field input:focus,
.contact-field textarea:focus,
.contact-select-wrap select:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.contact-field textarea { resize: vertical; min-height: 150px; }
.contact-field input[readonly] { opacity: 0.85; cursor: default; }

/* ---- Select with chevron ---- */
.contact-select-wrap { position: relative; }
.contact-select-wrap select { padding-right: 42px; cursor: pointer; }
.contact-select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-tertiary);
    font-size: 22px;
}

/* ---- Meta row (error + counter) ---- */
.contact-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.contact-counter {
    font-size: 12px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    white-space: nowrap;
}
.contact-error {
    font-size: 12.5px;
    color: #ef4444;
    min-height: 1em;
}
[data-theme="light"] .contact-error { color: #b91c1c; }

/* ---- Honeypot (visually removed) ---- */
.contact-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Actions ---- */
.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2px;
}
.contact-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 14px;
    background: var(--gradient-primary);
    color: #fff;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.28);
}
.contact-submit:hover:not(:disabled) { filter: brightness(1.06); }
.contact-submit:active:not(:disabled) { transform: translateY(1px); }
.contact-submit:disabled { opacity: 0.75; cursor: progress; }

.contact-spinner {
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: contactspin 0.7s linear infinite;
}
@keyframes contactspin { to { transform: rotate(360deg); } }

.contact-privacy {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-tertiary);
    margin: 0;
}
.contact-privacy a { color: var(--blue-500); text-decoration: none; }
.contact-privacy a:hover { text-decoration: underline; }

/* ---- Form-level error ---- */
.contact-form-error {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--legal-warning-bg, rgba(239, 68, 68, 0.12));
    border: 1px solid var(--legal-warning-border, rgba(239, 68, 68, 0.32));
    color: var(--legal-warning-fg, #ef4444);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Success card ---- */
.contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 44px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--legal-radius-card, 1.25rem);
    box-shadow: var(--shadow-lg);
}
.contact-success-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-bottom: 4px;
}
.contact-success-icon .material-symbols-outlined { font-size: 36px; color: var(--accent-green); }
.contact-success h2 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.contact-success p {
    font-size: 15.5px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 440px;
    line-height: 1.6;
}
.contact-success strong { color: var(--text-primary); }
.contact-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.contact-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.contact-secondary-btn:hover { filter: brightness(1.06); }
.contact-secondary-btn.ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}
.contact-secondary-btn.ghost:hover { color: var(--text-primary); border-color: var(--blue-500); filter: none; }

@media (prefers-reduced-motion: reduce) {
    .contact-spinner { animation: none; }
    .contact-submit,
    .contact-secondary-btn { transition: none; }
}
