/* ===============================
   REGISTRATION PAGE STYLES
   =============================== */

/* Register Hero */
.register-hero {
    padding: 140px 0 60px;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.register-hero-content {
    position: relative;
    z-index: 2;
}

.register-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 12px 0 16px;
}

.register-hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.register-counter {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    padding: 20px 40px;
}

.rc-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.rc-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Register Section */
.register-section {
    padding: 60px 0 100px;
    background: var(--bg-primary);
}

.register-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 40px;
    align-items: start;
}

/* Form Container */
.register-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 40px;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.required-star {
    color: var(--accent);
    font-weight: 700;
}

/* Form Sections */
.form-section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 28px;
}

.form-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fst-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: all var(--transition-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group input.error,
.form-group select.error {
    border-color: var(--accent);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.form-error {
    font-size: 0.75rem;
    color: var(--accent);
    min-height: 18px;
    transition: opacity 0.2s;
}

/* Custom Consent Checkbox */
.consent-statement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 22px;
    margin-bottom: 24px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.consent-statement input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-visual {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.checkbox-visual svg {
    width: 12px;
    height: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Checked State */
.consent-statement input[type="checkbox"]:checked + .checkbox-visual {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(220, 20, 20, 0.45);
}

.consent-statement input[type="checkbox"]:checked + .checkbox-visual svg {
    opacity: 1;
    transform: scale(1);
}

/* Hover & Focus */
.consent-statement:hover .checkbox-visual {
    border-color: var(--accent);
}

.consent-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    transition: color 0.2s;
}

.consent-statement:hover .consent-text {
    color: var(--text-primary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading span {
    opacity: 0;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Sidebar */
.register-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-med);
}

.sidebar-card:hover {
    border-color: var(--border-accent);
}

.sidebar-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 12px;
    color: var(--accent);
    margin-bottom: 14px;
}

.sidebar-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Sidebar Stats */
.sidebar-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
}

.sidebar-stats h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.sidebar-stat-row {
    display: grid;
    grid-template-columns: 100px 1fr 36px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.stat-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    border-radius: 3px;
    width: 0%;
    transition: width 1s var(--ease-out-expo);
}

.stat-count {
    text-align: right;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s var(--ease-out-expo);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    color: #22c55e;
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-content > p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-details {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-details strong {
    color: var(--text-primary);
}

.modal-content .btn {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .register-hero {
        padding: 110px 0 40px;
    }

    .register-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .register-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .register-hero {
        padding: 90px 0 30px;
    }

    .register-hero-title {
        font-size: clamp(1.8rem, 6vw, 2.6rem);
    }

    .register-hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .register-section {
        padding: 40px 0 80px;
    }

    .register-form-container {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .register-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-stats {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .register-hero {
        padding: 85px 0 24px;
    }

    .register-counter {
        padding: 14px 24px;
    }

    .rc-number {
        font-size: 2rem;
    }

    .register-form-container {
        padding: 20px 14px;
        border-radius: 14px;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .form-header h2 {
        font-size: 1.3rem;
    }

    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    .modal-content {
        padding: 28px 18px;
        border-radius: 18px;
        max-width: 95%;
    }

    .modal-icon {
        width: 60px;
        height: 60px;
    }
}

/* Foldables & Ultra Slim Phones (280px - 340px) */
@media (max-width: 340px) {
    .register-hero-title {
        font-size: 1.5rem;
    }

    .register-counter {
        padding: 10px 16px;
        width: 100%;
    }

    .rc-number {
        font-size: 1.6rem;
    }

    .register-form-container {
        padding: 16px 10px;
    }

    .btn-submit {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .sidebar-card {
        padding: 16px 12px;
    }
}

/* ============================================================
   Voter Photo Upload & 'Ni Barau Zan Zaɓa' Card Generator
   ============================================================ */
.voter-photo-group {
    margin-top: 10px;
}

.photo-upload-container {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px dashed rgba(220, 20, 20, 0.4);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.photo-upload-container:hover {
    border-color: var(--accent);
    background: rgba(220, 20, 20, 0.04);
}

.photo-avatar-preview {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220, 20, 20, 0.25);
    background-size: cover;
    background-position: center;
}

.photo-upload-meta {
    flex: 1;
}

.photo-upload-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.photo-upload-title strong {
    color: var(--accent-light);
}

.photo-upload-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.btn-choose-photo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-choose-photo:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Modal Card Customizations */
.modal-content.modal-card-content {
    max-width: 620px;
    padding: 32px 28px;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-header-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    margin-bottom: 20px;
}

.modal-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid #10b981;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-header-compact h2 {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.modal-card-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.modal-card-subtitle strong {
    color: var(--accent);
}

/* Generated Card Preview Display */
.generated-card-display {
    width: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #08090f;
    border: 1px solid rgba(220, 20, 20, 0.3);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(220, 20, 20, 0.15);
}

.card-loading-spinner {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-loading-spinner .spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(220, 20, 20, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.generated-card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

/* Card Action Buttons */
.card-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-download-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 700;
}

.btn-whatsapp-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-whatsapp-share:hover {
    background: #1ebd5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.modal-close-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .photo-upload-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .modal-header-compact {
        flex-direction: column;
        text-align: center;
    }
    .card-action-btns {
        grid-template-columns: 1fr;
    }
}
