/* ============================================
   CHARGED SERVICES - CONTACT FORM STYLES
   Requires shared.css to be loaded first.
   Uses existing CSS variables from :root.
   ============================================ */

/* ---- Layout ---- */
.contact-section {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 64px;
    align-items: start;
}

/* ---- Left column: intro & details ---- */
.contact-intro .section-sub {
    max-width: 380px;
}

.contact-details {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.65;
    transition: color 0.2s;
}

a.contact-detail-row:hover {
    color: var(--highlight);
}

.contact-detail-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(201,0,0,0.15);
    border-radius: 8px;
}

.contact-detail-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--highlight);
}

/* ---- Right column: form card ---- */
.contact-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

/* Subtle top-edge accent line */
.contact-form-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

/* ---- Form elements ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label abbr {
    text-decoration: none;
    color: var(--accent);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--body);
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    -webkit-appearance: none;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

/* Focus state */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Validation error state */
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--accent-bright);
}

.form-error {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-bright);
    margin-top: 6px;
    min-height: 0;
}

/* ---- Honeypot (spam trap) ---- */
.form-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* ---- Turnstile widget ---- */
.form-turnstile {
    margin-bottom: 20px;
}

/* Ensure the iframe doesn't overflow the card on mobile */
.form-turnstile .cf-turnstile iframe {
    max-width: 100%;
}

/* ---- Submit button additions ---- */
.btn-submit {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.btn-submit .btn-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.btn-submit:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-sending {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Ensure the hidden attribute always wins */
.btn-submit [hidden] {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 1.2s linear infinite;
}

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

.btn-submit[disabled] {
    opacity: 0.65;
    pointer-events: none;
}

/* ---- Success state ---- */
.form-success {
    text-align: center;
    padding: 48px 24px;
}

.form-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(201,0,0,0.15);
    border-radius: 50%;
}

.form-success-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--highlight);
}

.form-success h3 {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.form-success p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    max-width: 360px;
    margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .contact-intro .section-sub {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-wrap {
        padding: 28px 20px;
    }
}
