/* ==========================================================================
   Contact page (/contact)
   --------------------------------------------------------------------------
   Sits on the shared info-page look: info-page.css (breadcrumb, .pol-grid,
   .pol-sec cards and the ip- components: .ip-form, .ip-btn, .ip-callout)
   and page-hero.css (the .ph header). This file adds what only this page
   has: where the reply goes, the message box's count, the anti-spam sum,
   the sending and sent states, the "log in first" card a signed-out visitor
   sees, and the quick answers in the side column. Loaded by contact.php
   through the header hook ($page_styles), after info-page.css.
   ========================================================================== */

/* "Signed in as <name>" is one run of text beside the dot, so it wraps like
   text; the name keeps its own case and may break anywhere, since usernames
   of up to 50 characters have no spaces to break at */
.pg-contact .ct-signed { min-width: 0; }
.pg-contact .ct-who { text-transform: none; letter-spacing: .04em; color: #ffffff; overflow-wrap: anywhere; }

/* The side column holds short answers rather than a list of links, so it
   gets a little more room than the policy pages' 280px "On this page" list */
@media (min-width: 901px) {
    .pg-contact .pol-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* ---------- the form card ---------- */
.pg-contact .ct-card { padding-bottom: 22px; }
.pg-contact .ct-card > h2 { margin-bottom: 16px; }
.pg-contact .ct-form { gap: 20px; margin-bottom: 0; }

/* Where the reply goes: the account's address, instead of a read-only field */
.ct-from {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 255, 255, 0.035);
    border: 1px solid var(--ip-line, rgba(0, 255, 255, 0.12));
}
.ct-from > i { flex: none; margin-top: 5px; font-size: .9rem; color: var(--ip-accent, #00ffff); }
.pg-contact .ct-from p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ip-ink-2, #aab0bd); }
.pg-contact .ct-from strong { color: #ffffff; font-weight: 700; overflow-wrap: anywhere; }

/* Under the message box: an error on the left, the count on the right */
.ct-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.pg-contact .ct-meta .ip-counter { margin-left: auto; line-height: 1.6; }

.pg-contact .ct-captcha .cf-turnstile { width: 100%; }

.pg-contact .ct-form .ip-form__actions {
    gap: 14px 22px;
    margin-top: 2px;
    padding-top: 20px;
    border-top: 1px solid var(--ip-line, rgba(0, 255, 255, 0.12));
}
.pg-contact .ct-send { min-width: 220px; min-height: 46px; padding: 0 26px; }
/* Sending: the shared disabled look is a faded button; this one stays lit
   and its plane keeps moving, so it reads as working, not as switched off */
.pg-contact .ct-send[aria-busy="true"] { opacity: .85; cursor: progress; }
.ct-send[aria-busy="true"] i { animation: ct-fly 1s ease-in-out infinite; }
@keyframes ct-fly { 50% { transform: translate(3px, -3px); opacity: .55; } }

/* ---------- not sent / sent ---------- */
.pg-contact .ct-alert { margin-bottom: 18px; }
.pg-contact .ct-alert a { color: #ffffff; text-decoration-color: rgba(255, 255, 255, 0.45); }

.ct-done {
    padding: 28px 24px 26px;
    text-align: center;
    background: linear-gradient(180deg, rgba(46, 230, 160, 0.09) 0%, rgba(46, 230, 160, 0.02) 100%);
    border: 1px solid rgba(46, 230, 160, 0.32);
}
.ct-done:focus { outline: none; }
.ct-done__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border: 1px solid rgba(46, 230, 160, 0.45);
    background: rgba(46, 230, 160, 0.1);
    color: var(--ip-success, #2ee6a0);
    font-size: 1.7rem;
    box-shadow: 0 0 18px rgba(46, 230, 160, 0.18);
}
.pg-contact .ct-done p { margin: 0 auto 8px; max-width: 52ch; }
.pg-contact .ct-done .ct-done__title {
    margin-bottom: 6px;
    font-family: var(--ip-display, 'Orbitron', sans-serif);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .03em;
    color: #ffffff;
}
.pg-contact .ct-done .ct-done__meta { font-size: .96rem; color: var(--ip-ink-2, #aab0bd); }
.pg-contact .ct-done strong { overflow-wrap: anywhere; }
.ct-done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* ---------- signed out: log in first ---------- */
.pg-contact .ct-gate {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    padding-top: 22px;
    padding-bottom: 24px;
}
.ct-gate__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(0, 255, 255, 0.28);
    background: rgba(0, 255, 255, 0.06);
    color: var(--ip-accent, #00ffff);
    font-size: 1.15rem;
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.08);
}
.pg-contact .ct-gate h2 { margin: 2px 0 8px; }
.pg-contact .ct-gate p { max-width: 62ch; margin-bottom: 0; }
.ct-gate__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.pg-contact .ct-gate .ct-gate__note { font-size: .95rem; color: var(--ip-ink-3, #7c8594); }

/* Can't log in: the self-service routes, inside the same card */
.ct-gate__help { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ip-line, rgba(0, 255, 255, 0.12)); }
.pg-contact .ct-gate__help h3 { margin: 0 0 8px; }
.pg-contact .ct-gate__help ul { margin: 0; }
.pg-contact .ct-gate__help li:last-child { margin-bottom: 0; }
/* Send the confirmation email again: the login page's resend form, inline */
.pg-contact .ct-resend { display: flex; flex-wrap: wrap; gap: 8px; max-width: 440px; margin: 8px 0 4px; }
.pg-contact .ct-resend .ip-input { flex: 1 1 190px; width: auto; min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.pg-contact .ct-resend .ip-btn { flex: 0 0 auto; }
.ct-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- side column: quick answers ---------- */
.ct-help { background: rgba(10, 10, 15, 0.9); border: 1px solid rgba(0, 255, 255, 0.16); }
.ct-help__h {
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid var(--ip-line, rgba(0, 255, 255, 0.12));
    font-family: var(--ip-display, 'Orbitron', sans-serif);
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ip-ink-3, #7c8594);
}
.ct-help__list { margin: 0; padding: 4px 0; list-style: none; }
.ct-help__item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 13px 16px; }
.ct-help__item + .ct-help__item { border-top: 1px solid rgba(0, 255, 255, 0.07); }
.ct-help__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 255, 255, 0.05);
    color: var(--ip-accent, #00ffff);
    font-size: .78rem;
}
.ct-help__q {
    margin: 3px 0 3px;
    font-family: var(--ip-body, 'Rajdhani', sans-serif);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .01em;
    color: #ffffff;
}
.ct-help__a { margin: 0; font-size: .94rem; line-height: 1.5; color: var(--ip-ink-2, #aab0bd); }
.ct-help a {
    white-space: nowrap;
    color: var(--ip-accent, #00ffff);
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 255, 0.35);
    text-underline-offset: 3px;
}
.ct-help a:hover { color: #ffffff; text-decoration-color: currentColor; }

/* ---------- narrower screens ---------- */
@media (max-width: 900px) {
    /* The form (or the log-in card) first; the quick answers follow it */
    .pg-contact .pol-side { order: 0; }
    .ct-help__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Two answers per row: a rule above every row but the first */
    .ct-help__item + .ct-help__item { border-top: 0; }
    .ct-help__item:nth-child(n+3) { border-top: 1px solid rgba(0, 255, 255, 0.07); }
}
@media (max-width: 560px) {
    .pg-contact .ct-card { padding-bottom: 18px; }
    .pg-contact .ct-gate { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .pg-contact .ct-resend .ip-btn { flex: 1 1 100%; }
    .ct-help__list { grid-template-columns: minmax(0, 1fr); }
    .ct-help__item + .ct-help__item { border-top: 1px solid rgba(0, 255, 255, 0.07); }
    .ct-from { padding: 10px 12px; }
    .pg-contact .ct-form .ip-form__actions { gap: 12px; padding-top: 18px; }
    .pg-contact .ct-send,
    .ct-gate__actions .ip-btn,
    .ct-done__actions .ip-btn { flex: 1 1 100%; min-width: 0; }
    .ct-done { padding: 22px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .ct-send[aria-busy="true"] i { animation: none; }
}
