/**
 * Vote Engine - Frontend styles.
 *
 * Loaded ONLY on configured plugin pages (welcome, vote, summary, thank-you, etc.)
 * via VoteEngine\Frontend\Assets. The page-restricted enqueue means this CSS
 * never bloats other site pages.
 *
 * CUSTOMIZATION:
 *   To rebrand, override these CSS variables in your theme's stylesheet:
 *   
 *     :root {
 *       --ve-primary: #c79b3a;     // brand primary
 *       --ve-font-family: Georgia, serif;
 *     }
 *
 *   No PHP changes needed.
 *
 * @package VoteEngine
 */

:root {
    /* ===== Brand colors ===== */
    --ve-primary:        #2271b1;
    --ve-primary-hover:  #135e96;
    --ve-success:        #00a32a;
    --ve-success-hover:  #008a23;
    --ve-warning:        #dba617;
    --ve-danger:         #d63638;

    /* ===== Text ===== */
    --ve-text:           #1d2327;
    --ve-text-muted:     #50575e;

    /* ===== Backgrounds ===== */
    --ve-bg-card:        #ffffff;
    --ve-bg-soft:        #f0f0f1;
    --ve-bg-soft-info:   #f0f6fc;
    --ve-bg-soft-error:  #fcf0f1;
    --ve-bg-soft-success:   #ecf6ec;
    --ve-bg-answer:         #f6f7f7;
    --ve-text-success:      #14532d;

/* ===== Borders ===== */
    --ve-border:         #ccd0d4;
    --ve-border-info:    #c6d9ea;
    --ve-border-option:  #e5e5e5;

    /* ===== Hover states ===== */
    --ve-bg-option-hover: #f6f7f7;

    /* ===== Typography ===== */
    --ve-font-family:    Tahoma, Geneva, sans-serif;
    --ve-font-weight-bold: 700;
    --ve-font-weight-semi: 600;
    --ve-font-weight-regular: 400;
}

/* ============================================
   Base — applied to all .ve-* containers
   ============================================ */

[class*="ve-eligibility"],
[class*="ve-ballot"],
[class*="ve-summary"],
[class*="ve-thank-you"],
[class*="ve-session"],
[class*="ve-notice"] {
    font-family: var(--ve-font-family);
    color: var(--ve-text);
}

/* ============================================
   Notice banner (used by all forms)
   ============================================ */

.ve-notice {
    padding: 0.75em 1em;
    margin-bottom: 1em;
    border-radius: 4px;
    border-left: 4px solid #999;
    background: var(--ve-bg-soft);
    font-family: var(--ve-font-family);
}

.ve-notice-error {
    border-left-color: var(--ve-danger);
    background: var(--ve-bg-soft-error);
    color: #8a1f21;
}

.ve-notice-info {
    border-left-color: var(--ve-primary);
    background: var(--ve-bg-soft-info);
    color: #2c3338;
}

/* ============================================
   Eligibility form (/welcome/)
   ============================================ */

.ve-eligibility-form {
    max-width: 480px;
    margin: 0 auto;
    font-family: var(--ve-font-family);
}

.ve-eligibility-form .ve-field {
    margin: 1em 0;
}

.ve-eligibility-form .ve-field label {
    display: block;
    font-weight: var(--ve-font-weight-semi);
    margin-bottom: 0.35em;
}

.ve-eligibility-form .ve-field input[type="email"] {
    width: 100%;
    padding: 0.65em 0.8em;
    font-size: 1rem;
    font-family: var(--ve-font-family);
    border: 1px solid var(--ve-border);
    border-radius: 4px;
    box-sizing: border-box;
}

.ve-eligibility-form .ve-submit {
    margin-top: 1.25em;
}

.ve-eligibility-form .ve-submit button {
    padding: 0.75em 1.5em;
    font-size: 1rem;
    font-weight: var(--ve-font-weight-semi);
    font-family: var(--ve-font-family);
    background: var(--ve-primary);
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.ve-eligibility-form .ve-submit button:hover {
    background: var(--ve-primary-hover);
}

/* ============================================
   Ballot form (/cast-your-vote/)
   ============================================ */

.ve-ballot-form {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--ve-font-family);
}

/* Voter identity card (at top of form) */
.ve-identity {
    max-width: 760px;
    margin: 0 auto 1.25em;
    padding: 0.85em 1.1em;
    background: var(--ve-bg-soft-info);
    border: 1px solid var(--ve-border-info);
    border-radius: 6px;
    color: #2c3338;
    font-family: var(--ve-font-family);
}

.ve-identity-row {
    line-height: 1.55;
}

.ve-identity-meta {
    color: var(--ve-text-muted);
    font-size: 0.92em;
}

.ve-identity-icon {
    display: inline-block;
    margin-right: 0.25em;
}

/* Question cards */
.ve-ballot-form .ve-question {
    margin: 0 0 1.5em;
    padding: 1.25em 1.5em;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    background: var(--ve-bg-card);
}

.ve-ballot-form .ve-question-missing {
    border-color: var(--ve-danger);
    background: var(--ve-bg-soft-error);
}

.ve-ballot-form .ve-question-label {
    font-weight: var(--ve-font-weight-bold);
    font-size: 1.05em;
    color: var(--ve-text);
    margin-bottom: 0.5em;
    padding: 0;
}

.ve-ballot-form .ve-question-internal {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ve-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 0.85em;
}

.ve-ballot-form .ve-question-content {
    margin: 0.75em 0 1em;
    color: #2c3338;
    line-height: 1.5;
}

.ve-ballot-form .ve-question-content ul {
    margin: 0;
    padding-left: 1.25em;
}

.ve-ballot-form .ve-question-content li {
    margin: 0.25em 0;
}

/* Answer options (Approved / Not Approved / Abstained) */
.ve-ballot-form .ve-question-options {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.ve-ballot-form .ve-option {
    display: flex;
    align-items: center;
    gap: 0.65em;
    padding: 0.5em 0.75em;
    border: 1px solid var(--ve-border-option);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.ve-ballot-form .ve-option:hover {
    background: var(--ve-bg-option-hover);
}

.ve-ballot-form .ve-option input[type="radio"] {
    margin: 0;
}

/* Submit button */
.ve-ballot-form .ve-submit {
    text-align: center;
    margin: 2em 0 0;
}

.ve-ballot-form .ve-submit button {
    padding: 0.85em 2.5em;
    font-size: 1.05rem;
    font-weight: var(--ve-font-weight-semi);
    font-family: var(--ve-font-family);
    background: var(--ve-primary);
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.ve-ballot-form .ve-submit button:hover {
    background: var(--ve-primary-hover);
}

/* Responsive: options become a row on tablet+ */
@media (min-width: 600px) {
    .ve-ballot-form .ve-question-options {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ve-ballot-form .ve-option {
        flex: 1 1 30%;
        min-width: 200px;
    }
}


/* ============================================
   Summary form (/summary/)
   ============================================ */

.ve-summary {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--ve-font-family);
}

.ve-summary-intro {
    padding: 1em 1.25em;
    background: var(--ve-bg-soft-info);
    border-left: 4px solid var(--ve-primary);
    border-radius: 4px;
    margin-bottom: 1.5em;
    line-height: 1.5;
}

/* Summary item cards (one per question) */
.ve-summary-item {
    margin: 0 0 1.25em;
    padding: 1em 1.25em;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    background: var(--ve-bg-card);
}

.ve-summary-internal {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ve-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: var(--ve-font-weight-semi);
    margin-bottom: 0.65em;
}

.ve-summary-content {
    margin: 0.25em 0 0.85em;
    color: #2c3338;
    line-height: 1.5;
}

.ve-summary-content ul {
    margin: 0;
    padding-left: 1.25em;
}

.ve-summary-content li {
    margin: 0.25em 0;
}

/* Answer display with color-coded left border */
.ve-summary-answer {
    padding: 0.55em 0.85em;
    background: var(--ve-bg-answer);
    border-radius: 4px;
    border-left-width: 12px;
        border-left-style: solid;
        border-left-color: #999;
}

.ve-summary-answer-approved {
    border-left-color: var(--ve-success);
}

.ve-summary-answer-not_approved {
    border-left-color: var(--ve-danger);
}

.ve-summary-answer-abstained {
    border-left-color: var(--ve-warning);
}

.ve-summary-answer-label {
    color: var(--ve-text-muted);
    margin-right: 0.35em;
}

/* Confirm / Back button row */
.ve-summary-confirm {
    text-align: center;
    margin: 2em 0 0;
}

.ve-summary-buttons {
    display: flex;
    gap: 1em;
    justify-content: center;
    flex-wrap: wrap;
}

.ve-btn {
    display: inline-block;
    padding: 0.85em 1.75em;
    font-size: 1.05rem;
    font-weight: var(--ve-font-weight-semi);
    font-family: var(--ve-font-family);
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: 0;
}

.ve-btn-primary {
    background: var(--ve-success);
    color: #fff;
}

.ve-btn-primary:hover {
    background: var(--ve-success-hover);
}

.ve-btn-secondary {
    background: var(--ve-bg-soft);
    color: #2c3338;
    border: 1px solid var(--ve-border);
}

.ve-btn-secondary:hover {
    background: var(--ve-border-option);
}

/* Success notice (used on summary + thank-you flows) */
.ve-notice-success {
    border-left-color: var(--ve-success);
    background: var(--ve-bg-soft-success);
    color: var(--ve-text-success);
}

/* ============================================
   Thank you / receipt page (/thank-you/)
   ============================================ */

.ve-thankyou {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--ve-font-family);
}

/* Larger notice variant for the receipt page */
.ve-thankyou .ve-notice {
    padding: 1.1em 1.25em;
    margin-bottom: 1.5em;
    border-radius: 6px;
    border-left-width: 12px;
        border-left-style: solid;
        border-left-color: #999;
}

.ve-thankyou .ve-notice strong {
    font-size: 1.15em;
    display: block;
    margin-bottom: 0.25em;
}

.ve-thankyou .ve-notice p {
    margin: 0;
}

/* Receipt metadata bar */
.ve-receipt-meta {
    padding: 0.65em 1em;
    margin: 0 0 1.5em;
    background: var(--ve-bg-answer);
    border-radius: 4px;
    color: var(--ve-text-muted);
    font-size: 0.95em;
}

/* Receipt items (one per question) */
.ve-receipt-item {
    margin: 0 0 1.25em;
    padding: 1em 1.25em;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    background: var(--ve-bg-card);
}

.ve-receipt-internal {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ve-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: var(--ve-font-weight-semi);
    margin-bottom: 0.65em;
}

.ve-receipt-content {
    margin: 0.25em 0 0.85em;
    color: #2c3338;
    line-height: 1.5;
}

.ve-receipt-content ul {
    margin: 0;
    padding-left: 1.25em;
}

.ve-receipt-content li {
    margin: 0.25em 0;
}

/* Receipt answers with color-coded left border (same as summary page) */
.ve-receipt-answer {
    padding: 0.55em 0.85em;
    background: var(--ve-bg-answer);
    border-radius: 4px;
    border-left-width: 12px;
        border-left-style: solid;
        border-left-color: #999;
}

.ve-receipt-answer-approved {
    border-left-color: var(--ve-success);
}

.ve-receipt-answer-not_approved {
    border-left-color: var(--ve-danger);
}

.ve-receipt-answer-abstained {
    border-left-color: var(--ve-warning);
}

.ve-receipt-answer-label {
    color: var(--ve-text-muted);
    margin-right: 0.35em;
}

/* Print button area */
.ve-receipt-print {
    text-align: center;
    margin: 2em 0 0;
}

.ve-receipt-print .ve-btn {
    display: inline-block;
    padding: 0.65em 1.4em;
    font-size: 1rem;
    font-weight: var(--ve-font-weight-semi);
    font-family: var(--ve-font-family);
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--ve-border);
}

/* ============================================
   Print mode: clean paper receipt
   (FIX: was previously broken with PHP-style // comments)
   ============================================ */

@media print {
    /* Hide everything except our receipt */
    body > :not(.ve-thankyou) {
        display: none !important;
    }
    /* Strip down the receipt for paper */
    .ve-thankyou {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11pt;
        color: #000;
    }
    /* Hide the print button itself when printing */
    .ve-receipt-print,
    .ve-receipt-print * {
        display: none !important;
    }
    /* Avoid breaking items across pages */
    .ve-receipt-item {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
    }
    .ve-notice-success {
        border: 1px solid var(--ve-success) !important;
        page-break-inside: avoid;
    }
    /* Force ink-friendly contrast */
    .ve-receipt-content,
    .ve-receipt-answer,
    .ve-receipt-meta {
        color: #000 !important;
    }
}
/* ============================================
   Notice color overrides for thank-you page
   (Fix: thank-you's .ve-notice was overriding the
    color-coded success/error variants below.)
   ============================================ */

.ve-thankyou .ve-notice-success {
    border-left-color: var(--ve-success);
    background: var(--ve-bg-soft-success);
    color: var(--ve-text-success);
}

.ve-thankyou .ve-notice-error {
    border-left-color: var(--ve-danger);
    background: var(--ve-bg-soft-error);
    color: #8a1f21;
}

.ve-thankyou .ve-notice-info {
    border-left-color: var(--ve-primary);
    background: var(--ve-bg-soft-info);
    color: #2c3338;
}
