/* ==========================================================================
   Contact form: [sitepoint_contact_form]
   Everything is scoped to .tgx-enquiry so theme styles elsewhere are untouched.
   ========================================================================== */

.tgx-enquiry {
    --tgx-brand: #ab211e;
    --tgx-brand-dark: #8a1916;
    --tgx-brand-soft: #fdf1f0;
    --tgx-brand-ring: rgba(171, 33, 30, 0.18);
    --tgx-text: #1f2937;
    --tgx-muted: #6b7280;
    --tgx-border: #e5e7eb;
    --tgx-field: #f9fafb;
    padding: 28px 24px;
    color: var(--tgx-text);
    max-width: 640px;
    margin: 0 auto;
}

/* ---- Questions --------------------------------------------------------- */

.tgx-enquiry .formcheckbox {
    text-align: center;
}

.tgx-enquiry .formcheckbox h3 {
    margin: 0 0 18px;
    font-size: clamp(19px, 2.2vw, 24px);
    font-weight: 700;
    line-height: 1.35;
    color: var(--tgx-text);
}

.tgx-enquiry .formcheckbox > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tgx-enquiry .option {
    flex: 1 1 180px;
    max-width: 240px;
    padding: 12px 18px;
    border: 2px solid var(--tgx-border);
    border-radius: 999px;
    background: #fff;
    color: var(--tgx-text);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .1s;
}

.tgx-enquiry .option:hover {
    border-color: var(--tgx-brand);
    background: var(--tgx-brand-soft);
    color: var(--tgx-brand);
}

.tgx-enquiry .option:active {
    transform: scale(0.98);
}

.tgx-enquiry .option.active {
    border-color: var(--tgx-brand);
    background: var(--tgx-brand);
    color: #fff;
    box-shadow: 0 6px 16px var(--tgx-brand-ring);
}

/* Second question: replaces the first one after "Yes" */
.tgx-enquiry .users-question {
    display: none;
    animation: tgx-fade-in .25s ease-out;
}

/* "← Back" on the second question: returns to the first one */
.tgx-enquiry .tgx-back {
    display: block;
    margin: -8px auto 14px 0;
    padding: 6px 12px 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tgx-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.tgx-enquiry .tgx-back:hover,
.tgx-enquiry .tgx-back:focus-visible {
    background: var(--tgx-brand-soft);
    color: var(--tgx-brand);
    outline: none;
}

.tgx-enquiry .formcheckbox-divider {
    border: 0;
    border-top: 1px solid var(--tgx-border);
    margin: 24px 0 0;
}

/* ---- Result: messages and form ----------------------------------------
   Hidden until the matching answer is picked (see showBox() in trigrexam.js) */

.tgx-enquiry .contactform544,
.tgx-enquiry .contactform-notserving,
.tgx-enquiry .contactform542 {
    display: none;
    margin-top: 20px;
    animation: tgx-fade-in .25s ease-out;
}

.tgx-enquiry .contactform544,
.tgx-enquiry .contactform-notserving {
    padding: 16px 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

/* Not eligible */
.tgx-enquiry .contactform544 {
    background: var(--tgx-brand-soft);
    border: 1px solid #f3c9c7;
    color: var(--tgx-brand-dark);
}

/* Fewer than 100 users */
.tgx-enquiry .contactform-notserving {
    background: #fff8e6;
    border: 1px solid #f6dc9c;
    color: #8a5a00;
}

/* ---- Form fields ------------------------------------------------------- */

.tgx-enquiry .form-group {
    margin-bottom: 16px;
}

.tgx-enquiry .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tgx-text);
}

.tgx-enquiry .form-control {
    width: 100%;
    height: auto;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--tgx-text);
    font-size: 15px;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}

.tgx-enquiry .form-control::placeholder {
    color: #9ca3af;
}

.tgx-enquiry .form-control:focus {
    outline: none;
    border-color: var(--tgx-brand);
    box-shadow: 0 0 0 4px var(--tgx-brand-ring);
}

.tgx-enquiry textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

/* Mobile: [country] [+code] [number] */
.tgx-enquiry .mobile-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.tgx-enquiry .mobile-row #country_select {
    flex: 0 0 32%;
    min-width: 0;
}

.tgx-enquiry .mobile-row #selected_code {
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tgx-field);
    color: var(--tgx-muted);
    font-weight: 600;
}

.tgx-enquiry .mobile-row .mobile-input {
    flex: 1;
    min-width: 0;
}

.tgx-enquiry .g-recaptcha {
    margin: 4px 0 16px;
}

/* ---- Submit ------------------------------------------------------------ */

.tgx-enquiry .inputtype input[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--tgx-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--tgx-brand-ring);
    transition: background-color .2s, transform .1s, box-shadow .2s;
}

.tgx-enquiry .inputtype input[type="submit"]:hover {
    background: var(--tgx-brand-dark);
}

.tgx-enquiry .inputtype input[type="submit"]:active {
    transform: translateY(1px);
}

/* "Please fill all required details" message after a failed submit */
.praclr {
    max-width: 640px;
    margin: 0 auto 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fdf1f0;
    border: 1px solid #f3c9c7;
    color: #8a1916;
    font-weight: 500;
    text-align: center;
}

@keyframes tgx-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Narrow spots (sidebar, phones) */
@media (max-width: 480px) {
    .tgx-enquiry {
        padding: 22px 16px;
        border-radius: 12px;
    }

    .tgx-enquiry .option {
        max-width: none;
    }

    .tgx-enquiry .mobile-row {
        flex-wrap: wrap;
    }

    .tgx-enquiry .mobile-row #country_select {
        flex: 1 1 100%;
    }
}

/* ---- Popup: [sitepoint_contact_form popup="yes"] ----------------------- */

.tgx-popup-btn {
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    background: #ab211e;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.tgx-popup-btn:hover,
.tgx-popup-btn:focus-visible {
    background: #8a1916;
}

.tgx-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tgx-modal[hidden] {
    display: none;
}

.tgx-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    animation: tgx-fade-in .15s ease-out;
}

.tgx-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: tgx-fade-in .15s ease-out;
}

.tgx-modal-title {
    margin: 0;
    padding: 24px 56px 0 24px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.tgx-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 26px;
    line-height: 36px;
    cursor: pointer;
}

.tgx-modal-close:hover,
.tgx-modal-close:focus-visible {
    background: #fdf1f0;
    color: #ab211e;
    outline: none;
}

.tgx-modal .tgx-enquiry {
    padding-top: 36px;
}

html.tgx-modal-open,
html.tgx-modal-open body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .tgx-modal-backdrop,
    .tgx-modal-dialog {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tgx-enquiry *,
    .tgx-enquiry .contactform544,
    .tgx-enquiry .contactform-notserving,
    .tgx-enquiry .contactform542 {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Admin: Enquiry page
   ========================================================================== */

.enquiry-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.table.enquirytable {
    width: 100%;
    min-width: 1000px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.table.enquirytable th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    text-align: left;
    padding: 13px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.table.enquirytable td {
    padding: 12px 14px;
    color: #475569;
    vertical-align: top;
    border-bottom: 1px solid #eef2f7;
}

.table.enquirytable tbody tr:nth-child(even) {
    background: #fafafa;
}

.table.enquirytable tbody tr:hover {
    background: #f1f5f9;
}

/* Sno */
.table.enquirytable th:nth-child(1),
.table.enquirytable td:nth-child(1) {
    width: 30px;
    text-align: center;
}

/* Name */
.table.enquirytable th:nth-child(2),
.table.enquirytable td:nth-child(2) {
    min-width: 100px;
}

/* Mobile */
.table.enquirytable th:nth-child(3),
.table.enquirytable td:nth-child(3) {
    min-width: 100px;
    white-space: nowrap;
}

/* Email */
.table.enquirytable th:nth-child(4),
.table.enquirytable td:nth-child(4) {
    min-width: 150px;
}

/* Date */
.table.enquirytable th:nth-child(5),
.table.enquirytable td:nth-child(5) {
    min-width: 140px;
    white-space: nowrap;
}

/* Query type */
.table.enquirytable th:nth-child(6),
.table.enquirytable td:nth-child(6) {
    width: 120px;
    text-align: center;
}

/* Message */
.table.enquirytable th:nth-child(7),
.table.enquirytable td:nth-child(7) {
    min-width: 350px;
    max-width: 500px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.table.enquirytable td p {
    margin: 0;
}

/* ==========================================================================
   Admin: Settings > Trigrexam
   ========================================================================== */

.trigrexam-shortcodes {
    max-width: 900px;
}

.trigrexam-shortcodes input {
    width: 100%;
}
