/* Modern Form Styles */
.reminder-form-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.reminder-form-container *,
.reminder-form-container *::before,
.reminder-form-container *::after {
    box-sizing: border-box;
}

.reminder-form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

.reminder-form-header h1 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.reminder-form-header p {
    margin: 0.3rem 0 0;
    color: #666;
    font-size: 0.85rem;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

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

/* Form Fields */
.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

/* Required field indicator */
.form-field label .required {
    color: #dc3545;
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 0.65rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    min-height: 44px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid #0073aa;
    outline-offset: -1px;
    border-color: #0073aa;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: -1px;
    border-color: #0073aa;
}

/* Error state - only shown when JS adds .error class after validation */
.form-field input.error,
.form-field select.error,
.form-field textarea.error {
    border-color: #dc3545;
}

.form-field input.error:focus,
.form-field select.error:focus,
.form-field textarea.error:focus {
    border-color: #dc3545;
    outline-color: #dc3545;
}

.form-field textarea {
    resize: vertical;
    min-height: 70px;
}

/* Form Options Section - More Compact */
.form-options {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    margin-bottom: 1.25rem;
}

.form-options h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Regular Checkboxes */
.reminder-system-form .checkbox-group,
.checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    padding: 0.25rem 0;
    line-height: 1.3;
    min-height: 44px;
}

/* Required checkbox styling */
.checkbox-group label .required {
    color: #dc3545;
    font-weight: 600;
}

.checkbox-group input[type="checkbox"]:not(#reminder_repeat) {
    width: 17px;
    height: 17px;
    margin: 0;
    flex-shrink: 0;
}

/* iPhone-style Toggle Switch - Better Contrast */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin: 0;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background-color: #007cba;
}

input:focus-visible + .toggle-slider {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Toggle Label Styling - Better Contrast */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    padding: 0.25rem 0;
    line-height: 1.3;
    min-height: 44px;
}

/* Submit Button - More Compact */
.submit-button {
    width: 100%;
    padding: 0.85rem;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.submit-button:hover {
    background: #005a87;
}

.submit-button:focus-visible {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Error Messages */
.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* Success Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.85rem;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

/* Legacy Success/Error Messages */
.reminder-system-success {
    background: #d4edda;
    color: #155724;
    padding: 0.85rem;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.reminder-system-errors {
    background: #f8d7da;
    color: #721c24;
    padding: 0.85rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.reminder-system-error {
    margin: 0;
    color: #dc3545;
    font-weight: 500;
}

/* Spinner Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.reminder-form-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

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

/* reCAPTCHA */
.recaptcha-container {
    margin: 1.25rem 0;
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    .reminder-form-container {
        margin: 0 1rem;
        padding: 1.25rem;
    }

    .reminder-form-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

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

    .form-grid {
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .form-options {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .reminder-system-form .checkbox-group,
    .checkbox-group {
        gap: 1rem;
        flex-direction: column;
    }

    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 0.65rem;
    }

    .form-field textarea {
        min-height: 60px;
    }
}

/* Compact layout for larger screens */
@media (min-width: 1024px) {
    .reminder-form-container {
        max-width: 700px;
        padding: 1.75rem;
    }

    .form-grid {
        gap: 1.5rem;
    }

    .form-options {
        padding: 1.5rem;
    }

    .reminder-system-form .checkbox-group,
    .checkbox-group {
        gap: 2rem;
    }
}
