/*
 * /contact/ — focused note-to-Ivan form on ivsanz.com.
 * Mirrors the PSP /subscribe/ aesthetic (paper bg, Hanken Grotesk,
 * navy + purple) so the surface family across ivsanz.com surfaces is one.
 *
 * All selectors are .ctc-* prefixed so this file does not collide with
 * the site-global styles.css.
 */

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

[hidden] {
    display: none !important;
}

:root {
    --ctc-paper:        #f4f3f1;
    --ctc-navy:         #0e0d2a;
    --ctc-purple:       #8b5cf6;
    --ctc-text:         #0e0d2a;
    --ctc-text-muted:   #57534e;
    --ctc-text-faint:   #78716c;
    --ctc-border:       #e6e5e1;
    --ctc-error:        #b94a3b;

    --ctc-font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ctc-transition: 0.18s ease;
    --ctc-radius: 14px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.ctc-page {
    background: var(--ctc-paper);
    color: var(--ctc-text);
    font-family: var(--ctc-font);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ctc-container {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

/* ================================
   Card — heading, lede, form
   ================================ */

.ctc-card {
    display: flex;
    flex-direction: column;
}

.ctc-heading {
    font-size: clamp(2rem, 7vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--ctc-navy);
    margin-bottom: 0.75rem;
}

.ctc-lede {
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--ctc-text-muted);
    max-width: 44ch;
    margin-bottom: 1.75rem;
}

/* ================================
   Form
   ================================ */

.ctc-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Labels remain in DOM for screen readers, hidden visually
   so the placeholder carries the visible cue. */
.ctc-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ctc-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid var(--ctc-border);
    border-radius: var(--ctc-radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ctc-text);
    transition: border-color var(--ctc-transition), box-shadow var(--ctc-transition);
    -webkit-appearance: none;
    appearance: none;
}

.ctc-textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.ctc-input::placeholder {
    color: var(--ctc-text-faint);
}

.ctc-input:focus {
    outline: none;
    border-color: var(--ctc-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.ctc-input.is-invalid {
    border-color: var(--ctc-error);
}

.ctc-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ctc-button {
    position: relative;
    width: 100%;
    padding: 0.95rem 1.25rem;
    margin-top: 0.25rem;
    background: var(--ctc-navy);
    color: #ffffff;
    border: 1px solid var(--ctc-navy);
    border-radius: var(--ctc-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background-color var(--ctc-transition), border-color var(--ctc-transition), transform var(--ctc-transition);
}

.ctc-button:hover:not(:disabled) {
    background: #1a1840;
    border-color: #1a1840;
    transform: translateY(-1px);
}

.ctc-button:active:not(:disabled) {
    transform: translateY(0);
}

.ctc-button:focus-visible {
    outline: 2px solid var(--ctc-purple);
    outline-offset: 2px;
}

.ctc-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.ctc-button[data-loading="true"] .ctc-button-label {
    visibility: hidden;
}

.ctc-button-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.1rem;
    height: 1.1rem;
    margin: -0.55rem 0 0 -0.55rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--ctc-transition);
    animation: ctc-spin 0.8s linear infinite;
}

.ctc-button[data-loading="true"] .ctc-button-spinner {
    opacity: 1;
}

@keyframes ctc-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ctc-button-spinner { animation-duration: 2s; }
    .ctc-button:hover { transform: none; }
}

/* Honeypot — invisible to humans, present in DOM for bots */
.ctc-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Turnstile wrapper */
.ctc-turnstile {
    margin-top: 0.25rem;
    display: flex;
    justify-content: flex-start;
    min-height: 65px;
}

/* Status message under the form */
.ctc-msg {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--ctc-text-muted);
}

.ctc-msg.is-error {
    color: var(--ctc-error);
}

.ctc-note {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--ctc-text-faint);
}

/* ================================
   Result state (post-submit)
   ================================ */

.ctc-result {
    display: flex;
    flex-direction: column;
}

.ctc-result .ctc-heading {
    margin-bottom: 0.75rem;
}

.ctc-result .ctc-lede {
    margin-bottom: 0;
}

/* Decorative purple accent under success heading */
.ctc-result--success::before {
    content: '';
    display: block;
    width: 2.5rem;
    height: 3px;
    background: var(--ctc-purple);
    border-radius: 2px;
    margin-bottom: 1.25rem;
}

/* ================================
   Footer back-link
   ================================ */

.ctc-footer {
    margin-top: 2.5rem;
    text-align: left;
}

.ctc-back {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--ctc-text-faint);
    text-decoration: none;
    transition: color var(--ctc-transition);
}

.ctc-back:hover {
    color: var(--ctc-text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ctc-back:focus-visible {
    outline: 2px solid var(--ctc-purple);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ================================
   Responsive
   ================================ */

@media (min-width: 640px) {
    .ctc-container {
        padding: 3rem 2rem 2rem;
        gap: 2rem;
    }

    .ctc-lede {
        font-size: 1.2rem;
    }

    .ctc-button {
        width: auto;
        align-self: flex-start;
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
}

@media (min-width: 960px) {
    .ctc-container {
        padding-top: 4rem;
    }
}
