/* KempIT SecureForms - Form Styles */

.secure-form {
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.secure-form * {
    box-sizing: border-box;
}

/* Modal overlay styles */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal-content {
    background-color: white !important;
    border-radius: 8px !important;
}

.modal-body {
    background-color: white !important;
    padding: 20px !important;
}

/* Prevent modal from closing when clicking on form elements */
.modal-body .secure-form {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

/* Field width classes */
.secure-form .form-group-half {
    width: 49%;
    display: inline-block;
    vertical-align: top;
    margin-right: 0;
    box-sizing: border-box;
    padding-right: 1%;
}

.secure-form .form-group-third {
    width: 33.33%;
    display: inline-block;
    vertical-align: top;
    margin-right: 0;
    box-sizing: border-box;
    padding-right: 1%;
}

.secure-form .form-group-two-thirds {
    width: 66.66%;
    display: inline-block;
    vertical-align: top;
    margin-right: 0;
    box-sizing: border-box;
    padding-right: 1%;
}

.secure-form .form-group-quarter {
    width: 25%;
    display: inline-block;
    vertical-align: top;
    margin-right: 0;
    box-sizing: border-box;
    padding-right: 1%;
}

/* New row class */
.secure-form .form-group-new-row {
    clear: both;
}

/* Remove padding from last element in a row */
.secure-form .form-group:last-child,
.secure-form .form-group-half:nth-child(2n),
.secure-form .form-group-third:nth-child(3n),
.secure-form .form-group-two-thirds,
.secure-form .form-group-quarter:nth-child(4n) {
    padding-right: 0;
}

/* Inline radio and checkbox styles */
.secure-form .radio-inline .form-check,
.secure-form .checkbox-inline .form-check {
    display: inline-block;
    margin-right: 15px;
}

/* Text element styles */
.secure-form h2 {
    font-size: 1.8rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.secure-form h3 {
    font-size: 1.4rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    color: #444;
}

.secure-form p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.secure-form .form-divider {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 1.5rem 0;
}

.secure-form .form-group {
    margin-bottom: 1.5rem;
}

.secure-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.secure-form .required {
    color: #e74c3c;
}

.secure-form .form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.secure-form .form-control:focus {
    border-color: #D35400;
    outline: none;
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.2);
}

.secure-form textarea.form-control {
    min-height: 100px;
}

.secure-form .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.secure-form .form-check-input {
    margin-right: 0.5rem;
}

.secure-form .form-check-label {
    font-weight: normal;
}

.secure-form .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

.secure-form .btn-primary {
    background-color: #D35400;
    color: white;
}

.secure-form .btn-primary:hover {
    background-color: #A04000;
}

.secure-form .alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.secure-form .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.secure-form .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success and error message styles */
.secure-form-success {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.form-message {
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.alert {
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert i {
    margin-right: 0.5rem;
}

.alert .fa-check-circle {
    display: block;
    margin-bottom: 1rem;
}

.alert h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Repeating Sections Styles */
.repeating-section {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
}

.repeating-section-header h4 {
    color: #495057;
    margin-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.repeating-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.repeating-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.repeating-item-header h5 {
    margin: 0;
    color: #6c757d;
    font-size: 1.1rem;
}

.repeating-section-controls {
    text-align: center;
    margin-top: 15px;
}

.add-repeating-item {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.add-repeating-item:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.remove-item {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.remove-item:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .secure-form {
        padding: 0 15px;
    }
    
    .secure-form .form-group-half,
    .secure-form .form-group-third,
    .secure-form .form-group-two-thirds,
    .secure-form .form-group-quarter {
        width: 100%;
        display: block;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    /* Ensure proper spacing between stacked elements */
    .secure-form .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* Responsive adjustments for repeating sections */
    .repeating-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .repeating-item-header h5 {
        margin-bottom: 0;
    }
    
    .remove-item {
        align-self: flex-end;
    }
}
