/* Full-screen overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    color: white;
    font-family: sans-serif;
}

/* Spinner animation */
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Prevent background scroll when overlay is active */
body.no-scroll {
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f7f7f7;
    margin: 0;
    padding: 10px;
}

.container {
    max-width: 600px;
    background-color: #fff;
    padding: 20px;
    margin: auto;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 22px;
}

label {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
}

input, select {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.section-title {
    font-size: 15px;
    margin-top: 20px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

.error {
    color: red;
    font-size: 12px;
    margin-top: -6px;
    margin-bottom: 8px;
}

.btn {
    background-color: #28a745;
    color: white;
    padding: 10px;
    border: none;
    width: 100%;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.btn:hover {
    background-color: #218838;
}

/* Form Grid */
.form-grid {
    display: flex;
    gap: 10px;
}

.form-grid > div {
    flex: 1;
}

#language-select {
    width: 100%;
    margin-bottom: 15px;
}

/* Payment layout */
.payment-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-row > div {
    flex: 1;
}

/* Hide amount unless needed */
#amount-container {
    display: none;
}

/* Hide installment unless needed */
#installment-container {
    display: none;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 26px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* MODAL */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #f44336; /* red background for error */
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    color: white;
    border-radius: 5px;
    position: relative;
}

.close {
    color: white;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}