/**
 * VoteSecure Styles
 * Modern, clean design with blockchain theme
 */

/* ============================================================================
   VARIABLES & RESET
   ============================================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light-gray: #cbd5e1;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--bg);
    overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.navbar,
.masthead {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container,
.masthead .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-remove {
    background: var(--error);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #dc2626;
}

.btn-remove-small {
    background: var(--light-gray);
    color: var(--dark);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-small:hover {
    background: var(--error);
    color: var(--white);
}

.btn-copy {
    background: var(--light-gray);
    color: var(--dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary);
    color: var(--white);
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
    position: relative;
    padding: 6rem 0 8rem;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    z-index: -1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: float 3s ease-in-out infinite;
}

.card-1 { top: 20%; left: 10%; animation-delay: 0s; }
.card-2 { top: 40%; right: 10%; animation-delay: 1s; }
.card-3 { bottom: 20%; left: 20%; animation-delay: 2s; }

.card-icon {
    font-size: 2rem;
}

.card-text {
    font-weight: 600;
    color: var(--dark);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ============================================================================
   SECTIONS
   ============================================================================ */

.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 3rem;
}

/* Features Section */
.features-section {
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
    margin: 0;
}

/* How It Works Section */
.how-section {
    background: var(--bg);
}

.role-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    padding: 0.75rem 2rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.steps {
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--gray);
    margin: 0;
}

/* Security Section */
.security-section {
    background: var(--white);
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.security-item {
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.security-item h4 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.security-item p {
    color: var(--gray);
    margin: 0;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray);
    font-size: 0.875rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.radio-option input[type="radio"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-content {
    color: var(--primary);
}

.radio-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.radio-content p {
    margin: 0;
    color: var(--gray);
    font-size: 0.875rem;
}

/* ============================================================================
   ELECTION FORM (ORGANIZER)
   ============================================================================ */

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray);
    font-size: 1.125rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.progress-steps .step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    background: var(--bg);
}

.progress-steps .step-number {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gray);
    transition: var(--transition);
}

.progress-steps .step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.progress-steps .step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.progress-steps .step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
}

.progress-steps .step.active .step-label {
    color: var(--primary);
}

.election-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-step h2 {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

/* Question Cards */
.question-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-header h4 {
    margin: 0;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.option-item input[type="text"] {
    flex: 1;
}

/* Review Section */
.review-section,
.cost-estimate {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-section h3,
.cost-estimate h3 {
    margin-bottom: 1rem;
}

.review-item {
    margin-bottom: 1.5rem;
}

.review-questions {
    margin-bottom: 1.5rem;
	list-style-position: inside;
	padding-left: 0;
}


.review-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.review-item p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.review-item ul {
    margin-left: 1.5rem;
    color: var(--gray);
}

.cost-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--white);
    border-radius: var(--radius-sm);
}

.cost-row.total {
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    margin-top: 0.5rem;
}

.cost-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.warning-box {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.warning-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #92400e;
}

.warning-box ul {
    margin-left: 1.5rem;
    color: #92400e;
}

/* ============================================================================
   VOTING INTERFACE
   ============================================================================ */

.election-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.election-header h1 {
    margin-bottom: 1rem;
}

.election-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.election-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: var(--dark);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.status-upcoming {
    background: var(--light-gray);
    color: var(--dark);
}

.status-badge.status-active {
    background: var(--success);
    color: var(--white);
}

.status-badge.status-ended {
    background: var(--warning);
    color: var(--white);
}

.status-badge.status-results_available {
    background: var(--primary);
    color: var(--white);
}

.voting-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.question-block {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.question-block:last-of-type {
    border-bottom: none;
}

.question-text {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.option-label:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-label input:checked + span {
    font-weight: 600;
    color: var(--primary);
}

.form-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.form-note {
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* Receipt Card */
.receipt-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.receipt-card h3 {
    margin-bottom: 0.5rem;
}

.receipt-card > p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.receipt-field {
    margin-bottom: 1rem;
}

.receipt-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.hash-display,
.url-display {
    background: var(--white);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.receipt-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Success Message */
.success-message {
    background: #d1fae5;
    border: 2px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.success-message h3 {
    color: #065f46;
    margin-bottom: 0.5rem;
}

.success-message p {
    color: #047857;
    margin: 0;
}

.published-info {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.info-field {
    margin-bottom: 1.5rem;
}

.info-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.info-field .value {
    background: var(--white);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

/* ============================================================================
   MY ELECTIONS
   ============================================================================ */

.elections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.election-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.election-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.election-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.election-card-header h3 {
    margin: 0;
    flex: 1;
}

.election-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.election-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.stat-label {
    font-weight: 600;
    color: var(--gray);
}

.stat-value {
    font-weight: 700;
    color: var(--dark);
}

.election-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    color: var(--gray);
    padding: 3rem;
}

/* ============================================================================
   RESULTS
   ============================================================================ */

.results-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.results-grid {
    display: grid;
    gap: 2rem;
}

.result-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.result-card h3 {
    margin-bottom: 1.5rem;
}

.result-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.result-label span:first-child {
    font-weight: 600;
    color: var(--dark);
}

.result-count {
    color: var(--gray);
}

.progress-bar {
    height: 30px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}

.group-results {
    margin-top: 2rem;
}

.group-result-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.group-result-card h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.group-questions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.group-question strong {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

/* ============================================================================
   INFO CARDS
   ============================================================================ */

.info-card {
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h2 {
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.previous-ballot-info {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

/* ============================================================================
   VERIFICATION
   ============================================================================ */

.verification-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.verification-form {
    max-width: 600px;
    margin: 0 auto;
}

.verification-details {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.verification-details div {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.verification-details div:last-child {
    border-bottom: none;
}

.error-message {
    background: #fee2e2;
    border: 2px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.error-message h3 {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.error-message p {
    color: #dc2626;
    margin: 0;
}

/* ============================================================================
   LOADING & ERROR STATES
   ============================================================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    margin-top: 1rem;
    color: var(--gray);
}

.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-state h2 {
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--gray);
    margin-bottom: 2rem;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand p {
    color: var(--light-gray);
    margin-top: 1rem;
}

.footer-column h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-column a {
    display: block;
    color: var(--light-gray);
    margin-bottom: 0.5rem;
}

.footer-column a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--light-gray);
    margin: 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-visual {
        display: none;
    }
    
    .features-grid,
    .security-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .elections-grid {
        grid-template-columns: 1fr;
    }
    
    .election-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===========================================================
   JoyID / Wallet UI (Organizer page)
   Scoped so it only affects the organizer page
   =========================================================== */
.organizer-page #connectWalletBtn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.organizer-page #connectWalletBtn.connected {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.organizer-page #connectWalletBtn.connected:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.organizer-page #connectWalletBtn.loading {
  opacity: 0.7;
  cursor: wait;
}

.organizer-page #walletInfo {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  display: none;
  animation: slideIn 0.3s ease;
}
.organizer-page #walletInfo.show { display: block; }

.organizer-page .wallet-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.organizer-page .wallet-label { color: #6b7280; }
.organizer-page .wallet-balance { font-weight: 600; color: #10b981; }
.organizer-page .wallet-network { color: #6b7280; font-size: 0.85rem; }
.organizer-page .wallet-address {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* Notifications */
.organizer-page .notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 400px;
}
.organizer-page .notification.show { transform: translateX(0); }
.organizer-page .notification-success { border-left: 4px solid #10b981; }
.organizer-page .notification-error   { border-left: 4px solid #ef4444; }
.organizer-page .notification-info    { border-left: 4px solid #3b82f6; }
.organizer-page .notification-warning { border-left: 4px solid #f59e0b; }

/* Disconnect popover */
.organizer-page .wallet-disconnect-confirm {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
}
.organizer-page .wallet-disconnect-confirm.show { display: block; }
.organizer-page .disconnect-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Service status dots */
.organizer-page .service-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
}
.organizer-page .service-status.ready   { background: #10b981; }
.organizer-page .service-status.error   { background: #ef4444; }
.organizer-page .service-status.loading { background: #f59e0b; animation: pulse 1.5s ease-in-out infinite; }

/* Animations — note: `spin` already exists in your CSS; don't duplicate it */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ===========================================================
   JoyID / Wallet UI (Voter page)
   Scoped so it only affects the voter page
   =========================================================== */
.voter-page #connectWalletBtn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.voter-page #connectWalletBtn.connected {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}
.voter-page #connectWalletBtn.connected:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.voter-page #connectWalletBtn.loading {
  opacity: 0.7;
  cursor: wait;
}

.voter-page #walletInfo {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  display: none;
  animation: slideIn 0.3s ease;
}
.voter-page #walletInfo.show { display: block; }

.voter-page .wallet-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.voter-page .wallet-label { color: #6b7280; }
.voter-page .wallet-network { 
  font-weight: 600; 
  color: #10b981;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Service status dots for voter page */
.voter-page .service-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
  transition: all 0.3s ease;
}
.voter-page .service-status.ready   { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.voter-page .service-status.error   { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.voter-page .service-status.loading { background: #f59e0b; animation: pulse 1.5s ease-in-out infinite; }

/* Screen-reader-only text, e.g. "(opens in a new tab)" on external links. */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
