:root {
    --primary-green: #0f4d3a;
    --primary-green-light: #1a7f4e;
    --primary-green-accent: #d3efe2;
    --yellow-accent: #f2a83b;

    --white: #ffffff;
    --white-soft: #fbfdfc;
    --white-faint: #e8ecea;
    --white-muted: #6a7f74;

    --text: #163a2b;
    --text-muted: #6a7f74;
    --border: #e8ecea;

    --bg: #fbfdfc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.page-content {
    flex: 1;
    margin-left: 280px;
    padding: 28px;
    max-width: calc(100% - 280px);
}

.topbar {
    padding: 12px 6px;
    margin-bottom: 28px;
}

.title-registration {
    font-size: 36px;
    margin: 6px 0;
    color: var(--primary-green);
}

.subtitle-registration {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 18px;
}

/* Registration Form Styles */
.registration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(15, 77, 58, 0.08);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(15, 77, 58, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-green-accent);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-green-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.2rem;
}

.card-title-content {
    flex: 1;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--white-soft);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green-light);
    box-shadow: 0 0 0 3px rgba(26, 127, 78, 0.1);
}

.btn {
    background: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-green-light);
}

.btn-full {
    width: 100%;
}

.file-upload {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: var(--white-soft);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.file-upload:hover {
    border-color: var(--primary-green-light);
}

.file-upload-icon {
    margin-bottom: 10px;
    color: var(--white-muted);
}

.biometric-section {
    grid-column: 1 / -1;
}

.biometric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.biometric-item {
    text-align: center;
    padding: 20px;
    background: var(--white-soft);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.biometric-item:hover {
    background: var(--primary-green-accent);
    border-color: var(--primary-green-light);
}

.biometric-icon {
    margin-bottom: 10px;
    color: var(--primary-green);
}

.biometric-item h4 {
    margin-bottom: 5px;
    color: var(--text);
}

.biometric-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary-green);
    width: 0%;
    transition: width 0.5s ease;
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.biometric-content {
    width: 100%;
}

.biometric-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.biometric-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biometric-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text);
    width: 100%;
    min-height: 54px;
}

.btn-outline {
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary-green);
    background: var(--primary-green-accent);
}

.btn-light-green {
    background: var(--primary-green-accent);
    border: 2px solid var(--primary-green-accent);
    color: var(--primary-green);
}

.btn-light-green:hover {
    background: var(--primary-green-light);
    border-color: var(--primary-green-light);
    color: var(--white);
}

.biometric-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.biometric-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 5px 0 0 0;
    line-height: 1.4;
}

.voter-id-section {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

/* Scan Section */
.scan-section {
    display: flex;
    justify-content: start;
    margin: 20px 0;
}

.scan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 30px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text);
    width: 40%;
    min-height: 60px;
}

.scan-btn:hover {
    border-color: var(--primary-green);
    background: var(--primary-green-accent);
}

.scan-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Section Divider */
.section-divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 30px 0;
}

/* Voter Fields */
.voter-fields {
    width: 100%;
}

.field-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.field-group {
    flex: 1;
    min-width: 0;
}

/* Membership Section - Full Width */
.membership-section {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

/* Style for dropdown */
.form-control select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%236a7f74' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

.form-control select:focus {
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%231a7f4e' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
}

.additional-info-section {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

/* Section Title */
.section-title {
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.section-title-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
    margin: 0;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

/* File Upload Hint */
.file-upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding: 20px 0;
}

.cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text);
    text-decoration: none;
}

.cancel-btn:hover {
    border-color: var(--text-muted);
    background: var(--white-faint);
}

.register-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary-green);
    color: var(--white);
}

.btn-dark-green {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-dark-green:hover {
    background: var(--primary-green-light);
    border-color: var(--primary-green-light);
}

/* Four column layout for location fields */
.field-row.four-column {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.field-row.four-column .field-group {
    flex: 1;
    min-width: 0;
}

/* Membership Type Management Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.type-item:hover {
    background: var(--white-soft);
    border-color: var(--primary-green);
}

.type-actions {
    display: flex;
    gap: 8px;
}

.type-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--text);
}


/* Notification styles */
.notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error states */
.form-control.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* File list styles */
.file-list {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin: 5px 0;
    background: var(--white-soft);
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Camera preview styles */
.camera-preview {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin: 15px 0;
    background: var(--white-soft);
}

.camera-preview video {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Biometric scanner status */
.scanner-status {
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.scanner-status.connected {
    background: var(--primary-green-accent);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.scanner-status.disconnected {
    background: #fee;
    color: #c00;
    border: 1px solid #f00;
}

/* OCR preview */
.ocr-preview {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    background: var(--white-soft);
}

.ocr-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .field-row.three-column {
        flex-direction: column;
    }
    
    .biometric-row {
        flex-direction: column;
    }
    
    .scan-btn {
        width: 100%;
    }
    
    .camera-preview {
        height: 250px;
    }
}

/* Print styles */
@media print {
    .action-buttons,
    .scan-section,
    .biometric-btn {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Responsive adjustments for action buttons */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cancel-btn,
    .register-btn {
        width: 100%;
    }
    
    /* Stack location fields on mobile */
    .field-row.four-column {
        flex-direction: column;
    }
    
    .field-row.four-column .field-group {
        width: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scan-btn {
        width: 100%;
        min-width: auto;
    }
    
    .field-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .field-group {
        width: 100%;
    }
}

/* Responsive adjustments for biometric section */
@media (max-width: 768px) {
    .biometric-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .biometric-group {
        width: 100%;
    }
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .page-content {
        margin-left: 0;
        max-width: 100%;
        padding: 20px;
    }

    .field-row.four-column {
        flex-wrap: wrap;
    }
    
    .field-row.four-column .field-group {
        flex: 1 1 calc(50% - 15px);
        min-width: 200px;
    }
}

@media (max-width: 980px) {
    .registration-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .page-content {
        margin-left: 0;
        max-width: 100%;
        padding: 15px;
    }
    
    .registration-grid {
        grid-template-columns: 1fr;
    }
    
    .title-registration {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .biometric-grid {
        grid-template-columns: 1fr;
    }
}