/* =============================== */
/* Kenya Page Styles - Full UI      */
/* =============================== */

/* ---------- MAIN CONTAINER ---------- */
main.container {
    width: 95%;
    max-width: 1300px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}


/* ===============================
   SUBMIT PREFERENCES CARD
=============================== */
.card.submit-preferences {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px 25px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    margin: 0 auto 30px;
    width: 100%;
    max-width: 800px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.submit-preferences h2 {
    font-size: 1.9rem;
    color: #0d6efd;
    margin-bottom: 10px;
    text-align: center;
}

.card.submit-preferences p.small {
    font-size: 0.95rem;
    color: #555555;
    margin-bottom: 25px;
    text-align: start;
    line-height: 1.5;
}




/* ===============================
   MEDIA QUERY: 768px
=============================== */
@media (max-width: 768px) {

    main.container {
        width: 100%;       /* full width of viewport */
        margin: 5px auto;  /* smaller top/bottom margin */
        gap: 10px;         /* reduce vertical spacing */
        padding: 0 5px;    /* optional slight horizontal padding */
    }

    .card.submit-preferences {
        width: 98%;       /* take full container width */
        max-width: 98%;   /* remove max-width restriction */
        margin: 0 auto 10px; /* smaller bottom margin */
        padding: 12px 10px;  /* reduced padding for smaller screens */
    }

    .card.submit-preferences h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }

    .card.submit-preferences p.small {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .form-section {
        padding: 10px 8px; /* smaller fieldset padding */
        margin-bottom: 15px;
    }

    .form-section legend {
        font-size: 1rem;   
        padding: 0 6px;
        margin-left: 4px;
    }

    .form-row {
        margin-bottom: 8px; /* less spacing */
    }

    label {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .input,
    select,
    textarea {
        padding: 5px 6px; /* smaller inputs */
        font-size: 0.85rem;
    }

    textarea {
        min-height: 40px; /* slightly smaller textarea */
    }

    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 6px;  
    }

    .radio-group label,
    .checkbox-group label {
        font-size: 0.85rem;
    }

    #self_business {
        margin-top: 5px;
    }

    .cl-status-row {
        padding-bottom: 6px;
        margin-bottom: 6px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .edit-check-popup-content {
        padding: 1rem; 
        width: 320px;
    }

    .edit-check-popup-content .form-row {
        gap: 0.3rem;
        margin-top: 0.5rem;
    }

    .edit-check-popup-content input,
    .edit-check-popup-content select,
    .edit-check-popup-content textarea {
        padding: 0.35rem;
        font-size: 0.85rem;
    }

    .edit-check-popup-content .btn.small {
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
    }
}



/* ================= FIELDSETS & LEGENDS ================= */
.form-section {
    border: 2px solid #0d6efd;
    border-radius: 12px;
    padding: 20px 25px 25px;
    margin-bottom: 30px;
    position: relative;
}

.form-section legend {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0d6efd;
    padding: 0 10px;
    width: auto;
    margin-left: 20px;
    text-align: center;
    border: 2px solid #0d6efd;
    border-radius: 10px;
    background: #e7f0ff;
    box-shadow: 0 2px 6px rgba(13,110,253,0.15);
}


/* ================= FORM ROWS ================= */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #333333;
}

/* Required field asterisk */


/* Optional small label */
label small {
    color: #6c757d;
    font-weight: normal;
}

/* Inputs, selects, textareas */
.input,
select,
textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

textarea {
    min-height: 70px;
    resize: vertical;
}

/* Placeholder style */
::placeholder {
    color: #999999;
    font-style: italic;
}

/* Focus state */
.input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Error state */
.input.error,
select.error,
textarea.error {
    border-color: #dc3545; /* red */
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Checkbox styling */
input[type="checkbox"] {
    margin-right: 10px;
}




/*---------------Required-------------------*/
/* Required asterisk in red */
.required {
    color: red;
}

/* Error highlight */
.input.error,
select.error,
textarea.error {
    border: 2px solid red !important;
    background-color: #ffeaea;
}

/* Error message below field */
.error-msg {
    color: red;
    font-size: 0.85em;
    margin-top: 3px;
    display: block;
}


.input.error, select.error, textarea.error {
    border: 2px solid red !important;
    background-color: #ffeaea;
    transition: background-color 0.6s ease, border 0.6s ease;
}


.field-hint {
    font-size: 0.9em;
    color: #d40303; /* soft gray */
    font-style: italic;
    margin-left: 5px;
}


/* ================= BUTTONS ================= */

.btn-group {
    display: flex;
    flex-direction: row;  
    gap: 10px;  
    justify-content: flex-start;
    flex-wrap: nowrap;   
}

/* Buttons: prevent excessive width */
.btn-group .btn {
    flex: 0 0 auto;
    min-width: 100px; 
    max-width: 180px; 
    padding: 8px 16px;  
    text-align: center;
}

/* Secondary button styling */
.btn-group .btn.secondary {
    flex: 0 0 auto;
}


.btn {
    padding: 10px 22px;
    border-radius: 8px;
    background-color: #0d6efd;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: #e9ecef;
    color: #0d6efd;
}

.btn.secondary:hover {
    background-color: #d6d8db;
    transform: translateY(-2px);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .form-section {
        padding: 15px 15px 20px;
        margin-bottom: 20px;
    }

    .form-section legend {
        font-size: 1.2rem;
        padding: 0 8px;
        margin-left: 10px;
    }

    .form-row {
        margin-bottom: 14px;
    }

    label {
        font-size: 0.95rem;
    }

    .input,
    select,
    textarea {
        font-size: 0.95rem;
        padding: 8px 10px;
    }

    textarea {
        min-height: 60px;
    }

    .btn-group {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px; 
        flex-wrap: nowrap; 
    }

    .btn-group .btn {
        flex: 1 1 0;     
        min-width: 120px; 
        max-width: none;
        padding: 8px 0;  
        text-align: center;
    }

    .btn-group .btn.secondary {
        flex: 1 1 0;              /* match primary button width */
    }
}



/* ===================== Form Section ===================== */
.form-section {
    border: 2px solid #4CAF50; /* green border for section */
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Legend styling */
.form-section legend {
    padding: 0 10px;
    font-weight: 600;
    font-size: 1.25rem;
    color: #2a7a2a; /* darker green */
}

/* Form row layout */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

/* Labels */
.form-row label {
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 1rem;
}


/* Input fields */
.input[type="text"],
.input[type="email"],
textarea {
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    transition: border 0.25s, box-shadow 0.25s;
    font-family: inherit;
}

.input:focus,
textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.3);
    outline: none;
}

/* Checkbox and radio groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 6px;
}

/* Individual checkbox/radio labels */
.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s;
}

/* Style checkboxes and radio buttons */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50; /* modern green */
}

/* Optional small labels */
.form-row small {
    font-weight: 400;
    color: #999;
    margin-left: 5px;
}

/* Hover effects for labels */
.radio-group label:hover,
.checkbox-group label:hover {
    color: #2a7a2a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .form-section legend {
        font-size: 1.1rem;
        padding: 0 8px;
    }

    .form-row {
        margin-bottom: 14px;
    }

    .form-row label {
        font-size: 0.95rem;
    }

    .input[type="text"],
    .input[type="email"],
    textarea {
        font-size: 0.95rem;
        padding: 8px 10px;
    }

    textarea {
        min-height: 50px;
    }

    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-group label,
    .checkbox-group label {
        font-size: 0.95rem;
    }
}


.note {
    font-size: 0.9rem;
    color: #ff0606;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}



/* Specific for Self-Employed input */
#self_business {
    margin-top: 5px;
}

/* Add subtle separation for sub-sections */
.form-row + .form-row {
    margin-top: 12px;
}

/* Only for Current Living Status form-rows */
.cl-status-row {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #d4d4d4; /* light gray line separator */
}

/* Remove the last border */
.cl-status-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}



/*Position Priorities*/
#position-challenges {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    background-color: #f1f9f1; /* subtle green background */
    border-left: 4px solid #4CAF50; /* green accent line on the left */
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

#position-challenges strong {
    color: #dd0a0a; /* darker green for emphasis */
    font-weight: 600;
}

/* Pointer cursor for all select inputs in preferred candidates section */
#candidate_president,
#candidate_senator,
#candidate_governor,
#candidate_women_rep,
#candidate_mp,
#candidate_mca {
    cursor: pointer;
}


/* Date of Birth input */
#dob {
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    transition: border 0.25s ease, box-shadow 0.25s ease;
    font-family: inherit;
    cursor: pointer; /* indicates user can pick a date */
    background-color: #fff;
}

/* Focus state */
#dob:focus {
    border-color: #4CAF50; /* match other inputs */
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.3);
    outline: none;
}

/* Optional placeholder color for browsers that support it */
#dob::placeholder {
    color: #999;
    font-style: italic;
}


@media (max-width: 768px) {
    #self_business {
        margin-top: 8px;
    }

    .cl-status-row {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    #position-challenges {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    #dob {
        font-size: 0.95rem;
        padding: 8px 10px;
    }

    #candidate_president,
    #candidate_senator,
    #candidate_governor,
    #candidate_women_rep,
    #candidate_mp,
    #candidate_mca {
        font-size: 0.95rem;
    }
}










/* ==============================
   EDIT SECTION CONTAINER
============================== */
.edit-section {
    display: flex;
    justify-content: center; /* centers the button horizontally */
    margin-bottom: 20px; /* space between button and form */
}

/* ==============================
   EDIT BUTTON
============================== */
.edit-btn {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
    /* Add spacing if needed */
}

.edit-btn:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.edit-btn:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ==============================
   POPUP MODAL
============================== */
.edit-check-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.edit-check-popup.hidden {
    display: none;
}

.edit-check-popup-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.3s ease-in-out;
}

.edit-check-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #111;
    transition: color 0.2s ease-in-out;
}

.edit-check-close-btn:hover {
    color: #ef4444;
}

/* ==============================
   FORM ROWS IN POPUP
============================== */
.edit-check-popup-content .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.edit-check-popup-content input,
.edit-check-popup-content select,
.edit-check-popup-content textarea {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out;
}

.edit-check-popup-content input:focus,
.edit-check-popup-content select:focus,
.edit-check-popup-content textarea:focus {
    border-color: #2563eb;
    outline: none;
}

/* ==============================
   BUTTONS INSIDE POPUP
============================== */
.edit-check-popup-content .btn.small {
    background-color: #10b981;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.edit-check-popup-content .btn.small:hover {
    background-color: #059669;
    transform: translateY(-1px);
}




/* ==============================
   TOAST NOTIFICATIONS
============================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10000;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: #fff;
    min-width: 200px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: toastFadeIn 0.3s ease-in-out;
    opacity: 1;
    transition: opacity 0.5s ease-out, transform 0.3s ease-in-out;
}

.toast.success { background-color: #10b981; }
.toast.error   { background-color: #ef4444; }
.toast.warning { background-color: #f59e0b; }
.toast.info    { background-color: #3b82f6; }

/* ==============================
   ANIMATIONS
============================== */
@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ==============================
   RESPONSIVE: MOBILE / TABLET
============================== */
@media (max-width: 768px) {

    .edit-btn {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .edit-check-popup-content {
        padding: 1.5rem;
        width: 350px;
        max-width: 90%;
    }

    .edit-check-popup-content .form-row {
        gap: 0.4rem;
        margin-top: 0.75rem;
    }

    .edit-check-popup-content input,
    .edit-check-popup-content select,
    .edit-check-popup-content textarea {
        padding: 0.45rem;
        font-size: 0.95rem;
    }

    .edit-check-popup-content .btn.small {
        padding: 0.45rem 0.9rem;
        font-size: 0.9rem;
    }

    .toast {
        min-width: 180px;
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }

    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        gap: 0.4rem;
    }
}


/* ==============================
   TOGGLE SECTION
============================== */
/* ============================== 
   TOGGLE SECTION
============================== */
.toggle-section {
    margin-bottom: 10px;
    text-align: right; /* Aligns button to the right */
}

/* Stylish rectangular toggle button */
.toggle-btn {
    width: 50px;           /* Bigger width */
    height: 40px;          /* Bigger height */
    border-radius: 4px;    /* Slightly rounded corners */
    border: 1px solid #555;
    background-color: #fff;
    color: #555;
    font-weight: bold;
    font-size: 1.5rem;     /* Bigger + / - sign */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background-color: #f0f0f0;
    border-color: #333;
}
