/**
 * Form Styles - Premium Design
 * Based on de-cu.html and ung-cu.html designs
 */

/* Import Material Symbols */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;900&display=swap');

/* Form Container */
.dnvoting-form {
    max-width: 1024px;
    margin: 3rem auto;
    padding: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.dnvoting-form > form {
    background: white;
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Gradient Header */
.dnvoting-form > form::before {
    content: '';
    display: block;
    height: 0.5rem;
    background: linear-gradient(to right, #1a3a5f, #f59e0b, #1a3a5f);
}

/* Form Inner Padding */
.dnvoting-form > form > div:not(.dnvoting-form-actions) {
    padding: 2rem 3rem;
}

/* Page Header (outside form) */
.dnvoting-form-header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: none !important;
}

.dnvoting-form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 1rem;
}

.dnvoting-form-header p {
    color: #64748b;
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Section Headers */
.dnvoting-form-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.dnvoting-form-section-header .step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #1a3a5f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.dnvoting-form-section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.dnvoting-form-section-header .section-icon {
    font-size: 1.5rem;
    color: #1a3a5f;
    margin-right: 0.75rem;
}

.dnvoting-form-section-header .section-underline {
    height: 0.25rem;
    width: 3rem;
    background: #f59e0b;
    border-radius: 9999px;
    margin-top: 0.5rem;
}

/* Form Rows */
.dnvoting-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .dnvoting-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Form Groups */
.dnvoting-form-group {
    margin-bottom: 1.5rem;
}

.dnvoting-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.dnvoting-form-group label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* Input Fields */
.dnvoting-form-group input[type="text"],
.dnvoting-form-group input[type="email"],
.dnvoting-form-group input[type="tel"],
.dnvoting-form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: #0f172a;
    transition: all 0.2s;
}

.dnvoting-form-group select {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: #0f172a;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 8 10 12 14 8'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.dnvoting-form-group input:focus,
.dnvoting-form-group select:focus,
.dnvoting-form-group textarea:focus {
    outline: none;
    border-color: #1a3a5f;
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 58, 95, 0.1);
}

.dnvoting-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.dnvoting-form-group .description {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    margin-left: 0.25rem;
}

/* File Upload Areas */
.dnvoting-file-upload {
    border: 2px dashed #cbd5e1;
    border-radius: 1.5rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.dnvoting-file-upload:hover {
    border-color: rgba(26, 58, 95, 0.4);
    background: #f1f5f9;
}

.dnvoting-file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dnvoting-file-upload::before {
    content: '\e2c3';
    font-family: 'Material Symbols Outlined';
    font-size: 3rem;
    display: block;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: #e2e8f0;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.dnvoting-file-upload p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.dnvoting-file-upload p:first-of-type {
    font-weight: 600;
    color: #1a3a5f;
    margin-bottom: 0.25rem;
}

/* File Preview */
.dnvoting-file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dnvoting-file-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
}

/* Form Actions */
.dnvoting-form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 3rem;
    border-top: 1px solid #e2e8f0;
}

@media (min-width: 640px) {
    .dnvoting-form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* Buttons */
.dnvoting-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    border-radius: 0.5rem !important;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.dnvoting-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

.dnvoting-btn-primary {
    background: #1a3a5f;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(26, 58, 95, 0.3);
}

.dnvoting-btn-primary:hover {
    background: #0f172a;
    box-shadow: 0 20px 25px -5px rgba(26, 58, 95, 0.4);
    transform: translateY(-2px);
}

.dnvoting-btn-secondary {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 2px solid #fbbf24;
}

.dnvoting-btn-secondary:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Messages */
.dnvoting-message {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.dnvoting-message-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-left: 4px solid #10b981;
}

.dnvoting-message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

/* Modal */
.dnvoting-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

.dnvoting-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dnvoting-modal-content {
    background: white;
    border-radius: 1.5rem;
    max-width: 1200px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dnvoting-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.dnvoting-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.dnvoting-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
}

@media (min-width: 768px) {
    .dnvoting-modal-body {
        grid-template-columns: 1fr 2fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dnvoting-form {
        padding: 0.5rem;
    }
    
    .dnvoting-form > form > div:not(.dnvoting-form-actions) {
        padding: 1.5rem;
    }
    
    .dnvoting-form-actions {
        padding: 1.5rem;
    }
    
    .dnvoting-form-header h2 {
        font-size: 2rem;
    }
}

/* Loading Overlay */
.dnvoting-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.dnvoting-loading-overlay.active {
    display: flex;
}

.dnvoting-loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: dnvoting-spin 1s linear infinite;
}

@keyframes dnvoting-spin {
    to {
        transform: rotate(360deg);
    }
}

.dnvoting-loading-text {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
}

.dnvoting-loading-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-align: center;
}

/* Material Symbols */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}
