/**
 * Petition Dashboard Styles
 * Standalone page styles for petition creator dashboard
 */

/* ==================== Layout ==================== */

/* Override main.css body overflow:hidden for standalone petition pages */
html:has(.petition-dashboard-page),
html:has(.petition-dashboard-page) body {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

.petition-dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    overflow-y: auto;
    padding-bottom: 2rem;
}

/* ==================== Top Bar ==================== */

.petition-dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: #002868;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.petition-dashboard-topbar-left .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.petition-dashboard-topbar-left a {
    text-decoration: none;
    color: #fff;
}

.petition-dashboard-back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.petition-dashboard-back-link:hover {
    color: #fff;
}

/* ==================== Main Content ==================== */

.petition-dashboard-main {
    flex: 1;
    padding: 24px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ==================== Loading & Error States ==================== */

.petition-dashboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: #6b7280;
}

.petition-dashboard-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #002868;
    border-radius: 50%;
    animation: petition-spin 0.8s linear infinite;
}

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

.petition-dashboard-error {
    text-align: center;
    padding: 60px 24px;
}

.petition-dashboard-error h2 {
    color: #dc2626;
    margin-bottom: 12px;
}

.petition-dashboard-error p {
    color: #6b7280;
    margin-bottom: 24px;
}

.petition-login-prompt {
    text-align: center;
    padding: 80px 24px;
}

.petition-login-prompt h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.petition-login-prompt p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ==================== Buttons ==================== */

.petition-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.petition-btn-primary {
    background: #002868;
    color: #fff;
}

.petition-btn-primary:hover {
    background: #001a4a;
}

.petition-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.petition-btn-secondary {
    background: #fff;
    color: #002868;
    border: 1px solid #d1d5db;
}

.petition-btn-secondary:hover {
    background: #f9fafb;
    border-color: #002868;
}

.petition-btn-danger {
    background: #dc2626;
    color: #fff;
}

.petition-btn-danger:hover {
    background: #b91c1c;
}

.petition-btn-success {
    background: #059669;
    color: #fff;
}

.petition-btn-success:hover {
    background: #047857;
}

.petition-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.petition-btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s;
}

.petition-btn-icon:hover {
    background: #f3f4f6;
    color: #002868;
}

/* ==================== Header ==================== */

.petition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.petition-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.petition-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.petition-back-btn:hover {
    color: #002868;
}

/* ==================== Petition Cards (List View) ==================== */

.petition-cards {
    display: grid;
    gap: 16px;
}

.petition-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.petition-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #002868;
}

.petition-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.petition-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.petition-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.petition-card-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
}

.petition-card-stats strong {
    color: #1a1a2e;
}

/* Progress bar */
.petition-progress {
    margin-top: 12px;
}

.petition-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.petition-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #002868, #0047ab);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.petition-progress-text {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

/* ==================== Badges ==================== */

.petition-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.petition-status-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.petition-status-badge.active {
    background: #d1fae5;
    color: #059669;
}

.petition-status-badge.closed {
    background: #fee2e2;
    color: #dc2626;
}

.petition-status-badge.submitted {
    background: #dbeafe;
    color: #2563eb;
}

.petition-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #ede9fe;
    color: #7c3aed;
}

.petition-verification-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.petition-verification-badge.unverified {
    background: #f3f4f6;
    color: #6b7280;
}

.petition-verification-badge.voter-verified {
    background: #d1fae5;
    color: #059669;
}

.petition-verification-badge.flagged {
    background: #fef3c7;
    color: #d97706;
}

.petition-verification-badge.rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* ==================== Empty State ==================== */

.petition-empty-state {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.petition-empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #374151;
}

.petition-empty-state p {
    color: #6b7280;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ==================== Form (Create View) ==================== */

.petition-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.petition-form h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

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

.petition-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.petition-form-group .form-hint {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}

.petition-form-group input[type="text"],
.petition-form-group input[type="number"],
.petition-form-group input[type="date"],
.petition-form-group textarea,
.petition-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.petition-form-group input:focus,
.petition-form-group textarea:focus,
.petition-form-group select:focus {
    outline: none;
    border-color: #002868;
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
}

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

.petition-form-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

.petition-form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #374151;
}

/* Checkbox group for required fields */
.petition-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.petition-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.petition-checkbox-item:hover {
    border-color: #002868;
    background: #f8faff;
}

.petition-checkbox-item input[type="checkbox"] {
    accent-color: #002868;
    width: 16px;
    height: 16px;
}

/* Toggle switch */
.petition-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.petition-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.petition-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.petition-toggle input {
    display: none;
}

.petition-toggle input:checked + .petition-toggle-switch {
    background: #002868;
}

.petition-toggle input:checked + .petition-toggle-switch::after {
    transform: translateX(20px);
}

.petition-toggle-label {
    font-size: 14px;
    color: #374151;
}

/* Slug preview */
.petition-slug-preview {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    word-break: break-all;
}

.petition-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ==================== Detail View ==================== */

.petition-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.petition-detail-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.petition-detail-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.petition-detail-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.petition-detail-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.petition-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Stats Row */
.petition-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.petition-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.petition-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #002868;
    margin-bottom: 4px;
}

.petition-stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* QR Code Section */
.petition-qr-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    text-align: center;
}

.petition-qr-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.petition-qr-section img {
    max-width: 200px;
    margin: 0 auto 16px;
    display: block;
    border-radius: 8px;
}

.petition-qr-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== Signature Table ==================== */

.petition-signatures-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.petition-signatures-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.petition-signatures-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.petition-signatures-filters input,
.petition-signatures-filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.petition-signatures-filters input {
    flex: 1;
    min-width: 200px;
}

.petition-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.petition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.petition-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.petition-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.petition-table tr:hover {
    background: #f9fafb;
}

.petition-table-empty {
    text-align: center;
    padding: 40px 16px;
    color: #9ca3af;
}

/* Pagination */
.petition-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    font-size: 14px;
    color: #6b7280;
}

.petition-pagination-controls {
    display: flex;
    gap: 8px;
}

/* ==================== Audit Log ==================== */

.petition-audit-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.petition-audit-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    font-family: inherit;
}

.petition-audit-toggle:hover {
    background: #f9fafb;
}

.petition-audit-toggle .chevron {
    transition: transform 0.2s;
    font-size: 12px;
    color: #9ca3af;
}

.petition-audit-toggle .chevron.open {
    transform: rotate(180deg);
}

.petition-audit-content {
    padding: 0 24px 24px;
}

/* ==================== Footer ==================== */

.petition-dashboard-footer {
    text-align: center;
    padding: 16px 24px;
    color: #9ca3af;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

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

@media (max-width: 768px) {
    .petition-dashboard-main {
        padding: 16px;
    }

    .petition-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .petition-card-header {
        flex-direction: column;
    }

    .petition-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .petition-detail-actions {
        flex-direction: column;
    }

    .petition-detail-actions .petition-btn {
        width: 100%;
        justify-content: center;
    }

    .petition-signatures-filters {
        flex-direction: column;
    }

    .petition-signatures-filters input {
        min-width: unset;
    }

    .petition-form-actions {
        flex-direction: column;
    }

    .petition-form-actions .petition-btn {
        width: 100%;
        justify-content: center;
    }

    .petition-checkbox-group {
        flex-direction: column;
    }

    .petition-qr-actions {
        flex-direction: column;
    }

    .petition-pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .petition-dashboard-topbar {
        padding: 0 16px;
    }

    .petition-stats-row {
        grid-template-columns: 1fr;
    }

    .petition-card-stats {
        flex-direction: column;
        gap: 4px;
    }
}


/* ====================================================================
   PETITION SIGNING PAGE STYLES
   Standalone page for signing a petition via public link.
   All classes prefixed with "sign-" to avoid conflicts with dashboard.
   ==================================================================== */

/* ==================== Page Layout ==================== */

/* Override main.css body overflow:hidden for standalone signing page */
html:has(.sign-page),
html:has(.sign-page) body {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

.sign-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f5f5;
    overflow-y: auto;
}

/* ==================== Header ==================== */

.sign-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-logo {
    text-decoration: none;
    color: #4b5c09;
}

.sign-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ==================== Main Content ==================== */

.sign-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.sign-container {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* ==================== Progress Bar ==================== */

.sign-progress {
    padding: 1.25rem 1.5rem 0;
}

.sign-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.sign-progress-fill {
    height: 100%;
    background: #4b5c09;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.sign-progress-steps {
    display: flex;
    justify-content: space-between;
}

.sign-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.sign-progress-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.sign-progress-step--active .sign-progress-dot {
    background: #4b5c09;
    color: #fff;
}

.sign-progress-step--complete .sign-progress-dot {
    background: #4b5c09;
    color: #fff;
    font-size: 0.75rem;
}

.sign-progress-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
}

.sign-progress-step--active .sign-progress-label {
    color: #4b5c09;
    font-weight: 600;
}

/* ==================== Steps ==================== */

.sign-step {
    padding: 2rem 1.5rem;
}

/* --- Step 0: Petition Info --- */

.sign-step--info {
    text-align: center;
}

.sign-candidate-banner {
    background: linear-gradient(135deg, #f0f4e4 0%, #e8ecd8 100%);
    border: 1px solid #d4dbb8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sign-candidate-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5c09;
}

.sign-candidate-name {
    font-size: 1.25rem;
    margin: 0.25rem 0;
    color: #333;
}

.sign-candidate-office {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.sign-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.sign-description {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    text-align: left;
    white-space: pre-wrap;
}

.sign-org {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.sign-org strong {
    color: #374151;
}

/* Signature count / goal */

.sign-goal {
    margin-bottom: 1.5rem;
}

.sign-goal-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sign-goal-fill {
    height: 100%;
    background: linear-gradient(to right, #4b5c09, #6b7c19);
    border-radius: 5px;
    transition: width 0.5s ease;
    min-width: 2%;
}

.sign-goal-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6b7280;
}

.sign-goal-text strong {
    color: #1f2937;
}

.sign-count {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 1.25rem;
}

.sign-count strong {
    color: #1f2937;
}

.sign-deadline {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 1rem;
}

/* --- Step Titles --- */

.sign-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.sign-step-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* --- Form Fields --- */

.sign-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sign-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sign-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.sign-input {
    padding: 0.7rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.sign-input:focus {
    outline: none;
    border-color: #4b5c09;
    box-shadow: 0 0 0 3px rgba(75, 92, 9, 0.12);
}

select.sign-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.sign-field--error .sign-input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.sign-field-error {
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 500;
}

/* --- Attestation --- */

.sign-declaration {
    background: #fafaf8;
    border: 1px solid #e5e7d8;
    border-left: 4px solid #4b5c09;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
}

.sign-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    padding: 0.5rem 0;
}

.sign-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    accent-color: #4b5c09;
    cursor: pointer;
}

.sign-privacy-consent {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.sign-privacy-text {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.sign-input--signature {
    font-size: 1.1rem;
    font-style: italic;
    letter-spacing: 0.01em;
}

.sign-signature-feedback {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
}

.sign-match {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sign-match--valid {
    color: #22c55e;
}

.sign-match--valid::before {
    content: '\2713';
}

.sign-match--invalid {
    color: #ef4444;
}

.sign-match--invalid::before {
    content: '\2717';
}

.sign-geolocation-opt {
    text-align: center;
    margin-top: 0.75rem;
}

.sign-geolocation-status {
    font-size: 0.8rem;
    color: #22c55e;
    text-align: center;
    margin-top: 0.5rem;
}

/* --- CAPTCHA Step --- */

.sign-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.sign-summary h3 {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sign-summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.sign-summary-signer {
    font-size: 0.9rem;
    color: #4b5563;
}

.sign-captcha-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sign-captcha-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

#hcaptcha-container {
    display: flex;
    justify-content: center;
}

.sign-captcha-error {
    color: #ef4444;
    font-size: 0.85rem;
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 6px;
}

.sign-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    color: #dc2626;
    font-size: 0.9rem;
}

/* --- Confirmation Step --- */

.sign-step--confirmation {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.sign-success-icon {
    margin-bottom: 1.25rem;
}

.sign-checkmark {
    width: 64px;
    height: 64px;
}

.sign-checkmark circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: sign-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.sign-checkmark path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: sign-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes sign-stroke {
    100% { stroke-dashoffset: 0; }
}

.sign-confirmation-title {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.sign-verification {
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
}

.sign-verification--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sign-verification--pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.sign-confirmation-count {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0.75rem 0 1.5rem;
}

/* QR Code Sharing Section */
.sign-share-qr {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.sign-share-qr-label {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.sign-qr-container {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0;
}

.sign-qr-image {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.sign-btn--small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.sign-share {
    margin: 1.5rem 0;
    text-align: center;
}

.sign-share p {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.sign-share-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sign-cta-account {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* --- Error & Already Signed Pages --- */

.sign-step--error,
.sign-step--already-signed {
    text-align: center;
    padding: 3rem 1.5rem;
}

.sign-error-icon {
    margin-bottom: 1rem;
}

.sign-error-message {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* ==================== Signing Buttons ==================== */

.sign-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, opacity 0.2s, transform 0.1s;
    font-family: inherit;
    min-height: 44px;
}

.sign-btn:active {
    transform: scale(0.98);
}

.sign-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sign-btn--primary {
    background: #4b5c09;
    color: #fff;
}

.sign-btn--primary:hover:not(:disabled) {
    background: #5d7109;
}

.sign-btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.sign-btn--secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.sign-btn--large {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    max-width: 320px;
}

.sign-btn--link {
    background: none;
    color: #4b5c09;
    padding: 0.5rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
}

.sign-btn--link:hover {
    text-decoration-color: #4b5c09;
}

.sign-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sign-spin 0.6s linear infinite;
}

@keyframes sign-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== Step Actions Footer ==================== */

.sign-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
    gap: 0.75rem;
}

/* ==================== Footer ==================== */

.sign-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.sign-footer a {
    color: #4b5c09;
    text-decoration: none;
}

.sign-footer a:hover {
    text-decoration: underline;
}

/* ==================== Toast Notifications ==================== */

.sign-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: bottom 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.sign-toast--visible {
    bottom: 24px;
}

.sign-toast--info {
    background: #374151;
    color: #fff;
}

.sign-toast--success {
    background: #15803d;
    color: #fff;
}

.sign-toast--error {
    background: #dc2626;
    color: #fff;
}

/* ==================== Signing Page Responsive ==================== */

@media (min-width: 768px) {
    .sign-main {
        padding: 2.5rem 1.5rem;
        align-items: center;
    }

    .sign-step {
        padding: 2.5rem 2rem;
    }

    .sign-title {
        font-size: 1.75rem;
    }

    .sign-step-title {
        font-size: 1.4rem;
    }

    .sign-progress-label {
        font-size: 0.8rem;
    }

    .sign-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Fields that should span full width */
    .sign-form .sign-field:nth-child(n+5) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .sign-container {
        max-width: 640px;
    }
}

/* ==================== Accessibility ==================== */

@media (prefers-reduced-motion: reduce) {
    .sign-checkmark circle,
    .sign-checkmark path,
    .sign-progress-fill,
    .sign-goal-fill,
    .sign-toast,
    .sign-btn-spinner {
        animation: none;
        transition: none;
    }

    .sign-checkmark circle {
        stroke-dashoffset: 0;
    }

    .sign-checkmark path {
        stroke-dashoffset: 0;
    }
}

.sign-btn:focus-visible,
.sign-input:focus-visible,
.sign-checkbox-label input:focus-visible {
    outline: 2px solid #4b5c09;
    outline-offset: 2px;
}

/* ==================== Print ==================== */

@media print {
    .sign-header,
    .sign-footer,
    .sign-step-actions,
    .sign-share,
    .sign-cta-account {
        display: none;
    }

    .sign-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ==================== Petition Creator Modal ==================== */

.petition-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: petitionModalFadeIn 0.2s ease;
}

@keyframes petitionModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.petition-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: petitionModalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform, opacity;
}

@keyframes petitionModalSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.petition-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.petition-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.petition-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
}

.petition-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.petition-modal-close:focus-visible {
    outline: 2px solid #4b5c09;
    outline-offset: 2px;
}

/* Step Dots */
.petition-modal-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.petition-modal-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.2s;
}

.petition-modal-step-dot.active {
    background: #4b5c09;
    box-shadow: 0 0 0 3px rgba(75, 92, 9, 0.2);
}

.petition-modal-step-dot.completed {
    background: #86efac;
}

/* Body */
.petition-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Footer */
.petition-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Buttons */
.petition-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.petition-modal-btn-primary {
    background: #002868;
    color: #fff;
}

.petition-modal-btn-primary:hover {
    background: #001a4a;
}

.petition-modal-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.petition-modal-btn-secondary {
    background: #fff;
    color: #002868;
    border: 1px solid #d1d5db;
}

.petition-modal-btn-secondary:hover {
    background: #f9fafb;
    border-color: #002868;
}

.petition-modal-btn:focus-visible {
    outline: 2px solid #4b5c09;
    outline-offset: 2px;
}

/* Step Content */
.petition-modal-step {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.petition-modal-step-header h4 {
    margin: 0 0 0.25rem;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.petition-modal-step-header p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Form Fields */
.petition-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.petition-modal-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.petition-modal-field small {
    font-size: 12px;
    color: #9ca3af;
}

.petition-modal-field.has-error .petition-modal-input,
.petition-modal-field.has-error .petition-modal-textarea,
.petition-modal-field.has-error .petition-modal-select {
    border-color: #dc2626;
}

.petition-modal-error {
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

.petition-modal-input,
.petition-modal-textarea,
.petition-modal-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.petition-modal-input:focus,
.petition-modal-textarea:focus,
.petition-modal-select:focus {
    outline: none;
    border-color: #4b5c09;
    box-shadow: 0 0 0 3px rgba(75, 92, 9, 0.15);
}

.petition-modal-textarea {
    resize: vertical;
    min-height: 80px;
}

.petition-modal-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Field Row (side by side) */
.petition-modal-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Field Groups */
.petition-modal-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.petition-modal-group-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Always-included fields (non-toggleable) */
.petition-modal-always-fields {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.petition-modal-fixed-field {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

/* Checkbox Group */
.petition-modal-checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.petition-modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 14px;
}

.petition-modal-checkbox-label:hover {
    border-color: #4b5c09;
    background: #f9fafb;
}

.petition-modal-checkbox-label input[type="checkbox"] {
    accent-color: #4b5c09;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.petition-modal-checkbox-text {
    color: #374151;
    font-size: 14px;
}

/* Toggle Switch */
.petition-modal-toggle-label {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
}

.petition-modal-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.petition-modal-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.petition-modal-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.petition-modal-toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.petition-modal-toggle-switch input:checked + .petition-modal-toggle-slider {
    background: #4b5c09;
}

.petition-modal-toggle-switch input:checked + .petition-modal-toggle-slider::after {
    transform: translateX(20px);
}

.petition-modal-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.petition-modal-toggle-text span {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.petition-modal-toggle-text small {
    font-size: 12px;
    color: #9ca3af;
}

/* Help Icon Tooltip */
.petition-modal-help-icon {
    display: inline-block;
    cursor: help;
    color: #6b7280;
    font-size: 16px;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
}

.petition-modal-help-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: 260px;
    z-index: 10001;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.petition-modal-help-icon:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    z-index: 10001;
    pointer-events: none;
}

/* Candidate Section */
.petition-modal-candidate-section {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.petition-modal-candidate-section h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.petition-modal-candidate-note {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 6px;
}

.petition-modal-slug-preview {
    font-family: monospace;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

/* Review Layout */
.petition-modal-review {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.petition-modal-review-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
}

.petition-modal-review-section h4 {
    margin: 0 0 0.75rem;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.petition-modal-review-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.petition-modal-review-item {
    display: flex;
    gap: 0.75rem;
}

.petition-modal-review-item dt {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    min-width: 120px;
    flex-shrink: 0;
}

.petition-modal-review-item dd {
    margin: 0;
    font-size: 14px;
    color: #1a1a2e;
    word-break: break-word;
}

.petition-modal-review-description {
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

.petition-modal-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
}

.petition-modal-notice p {
    margin: 0;
    font-size: 13px;
    color: #1e40af;
}

/* Success State */
.petition-modal-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.petition-modal-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.petition-modal-success h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.petition-modal-success-title {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    max-width: 400px;
}

/* QR Code */
.petition-modal-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
}

.petition-modal-qr-image {
    width: 180px;
    height: 180px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.petition-modal-qr-loading {
    color: #9ca3af;
    font-size: 13px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.petition-modal-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #002868;
    border-radius: 50%;
    animation: petition-spin 0.8s linear infinite;
}

/* Signing Link */
.petition-modal-signing-link {
    width: 100%;
    max-width: 440px;
    text-align: left;
}

.petition-modal-signing-link label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.petition-modal-link-row {
    display: flex;
    gap: 0.5rem;
}

.petition-modal-link-input {
    flex: 1;
    font-size: 13px;
    font-family: monospace;
    background: #f9fafb;
}

/* Success Actions */
.petition-modal-success-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.petition-modal-published-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #d1fae5;
    color: #059669;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== Petition Modal: Mobile Bottom Sheet ==================== */

@media screen and (max-width: 767px) {
    .petition-modal-overlay {
        align-items: flex-end;
    }

    .petition-modal-content {
        width: 100%;
        max-width: none;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: petitionModalBottomSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes petitionModalBottomSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Handle bar for drag hint */
    .petition-modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #dee2e6;
        border-radius: 2px;
    }

    .petition-modal-header {
        padding-top: 24px;
        position: relative;
    }

    .petition-modal-checkbox-group {
        grid-template-columns: 1fr;
    }

    .petition-modal-field-row {
        grid-template-columns: 1fr;
    }

    .petition-modal-review-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .petition-modal-review-item dt {
        min-width: auto;
    }

    .petition-modal-qr-image {
        width: 140px;
        height: 140px;
    }
}

/* ==================== Petition Modal: Reduced Motion ==================== */

@media (prefers-reduced-motion: reduce) {
    .petition-modal-overlay,
    .petition-modal-content {
        animation: none !important;
    }

    .petition-modal-content {
        transform: none !important;
        opacity: 1 !important;
    }

    .petition-modal-toggle-slider,
    .petition-modal-toggle-slider::after,
    .petition-modal-step-dot {
        transition: none !important;
    }
}

/* ====================================================================
   SIGNING FLOW: CAPTCHA STEP
   ==================================================================== */

.sign-captcha-step {
    text-align: center;
}

.sign-captcha-step .sign-captcha-wrapper {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

#sign-hcaptcha-widget {
    display: flex;
    justify-content: center;
}

.sign-captcha-verified {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #15803d;
    font-size: 1rem;
    font-weight: 600;
}

.sign-captcha-verified-icon {
    font-size: 1.25rem;
}

/* ====================================================================
   SIGNING FLOW: VOTER VERIFICATION STEP
   ==================================================================== */

.sign-voter-verify-step {
    text-align: center;
}

.sign-verify-info-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.sign-verify-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.9rem;
}

.sign-verify-info-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.sign-verify-info-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 80px;
}

.sign-verify-info-value {
    color: #1f2937;
    text-align: right;
}

/* Verification result display */
.sign-verify-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem 0 1.5rem;
    text-align: left;
    font-size: 0.9rem;
}

.sign-verify-result-icon {
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-verify-result p {
    margin: 0;
    line-height: 1.4;
}

.sign-verify-result--matched {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.sign-verify-result--matched .sign-verify-result-icon {
    background: #dcfce7;
    color: #15803d;
}

.sign-verify-result--not-found {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.sign-verify-result--not-found .sign-verify-result-icon {
    background: #fef3c7;
    color: #d97706;
}

.sign-verify-result--error {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.sign-verify-result--error .sign-verify-result-icon {
    background: #f3f4f6;
    color: #9ca3af;
}

/* ====================================================================
   SIGNING FLOW: REVIEW STEP
   ==================================================================== */

.sign-review-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.sign-review-field {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.sign-review-field:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.sign-review-field-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 90px;
    flex-shrink: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sign-review-field-value {
    flex: 1;
    color: #1f2937;
    word-break: break-word;
}

.sign-review-field-value em {
    color: #9ca3af;
    font-style: italic;
}

.sign-review-edit-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
}

.sign-review-field-lock {
    font-size: 0.85rem;
    color: #9ca3af;
    flex-shrink: 0;
    cursor: help;
}

/* Locked field styling */
.sign-review-field.locked {
    background: #fafafa;
}

.sign-review-field.locked .sign-review-field-value {
    color: #6b7280;
}

/* Inline edit mode */
.sign-review-field--editing {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
}

.sign-review-edit-input {
    font-size: 0.9rem;
}

.sign-review-edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.sign-btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    min-height: 32px;
}

/* Lock notice */
.sign-review-lock-notice {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
}

/* Verification status in review */
.sign-review-verification {
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.sign-review-verification--matched {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sign-review-verification--not-found {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.sign-review-verification--error {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ====================================================================
   SIGNING FLOW: ATTESTATION REVEAL
   ==================================================================== */

.sign-attestation-reveal {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sign-attestation-reveal--visible {
    max-height: 500px;
}

.sign-signature-block {
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.sign-signature-block .sign-field {
    width: 100%;
}

.sign-signature-block .sign-btn--large {
    margin-top: 0.5rem;
}

/* ====================================================================
   SIGNING FLOW: SPAM NOTICE
   ==================================================================== */

.sign-spam-notice {
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
    line-height: 1.4;
}

/* ====================================================================
   DASHBOARD: VERIFICATION BALANCE SECTION
   ==================================================================== */

.petition-verification-balance-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.petition-verification-balance-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.petition-verification-balance-bar-wrapper {
    margin-bottom: 16px;
}

.petition-verification-balance-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.petition-verification-balance-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.petition-verification-balance-fill {
    height: 100%;
    background: linear-gradient(90deg, #002868, #0047ab);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.petition-verification-balance-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.petition-verification-purchase-history {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.petition-verification-purchase-history h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

/* ====================================================================
   SIGNING FLOW: MOBILE RESPONSIVE ADDITIONS
   ==================================================================== */

@media (max-width: 480px) {
    .sign-verify-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }

    .sign-verify-info-value {
        text-align: left;
    }

    .sign-review-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .sign-review-field-label {
        min-width: auto;
    }

    .sign-verify-result {
        flex-direction: column;
        text-align: center;
    }

    .petition-verification-balance-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
