/* ========================================
   Minimal Form Theme with Light/Dark Mode
   CSS-Only Theme Detection
   ======================================== */

:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --button-bg: #dc3545;
    --button-hover: #c82333;
    --button-text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Dark Theme - Automatic detection based on system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #242424;
        --text-primary: #e8e8e8;
        --text-secondary: #b0b0b0;
        --border-color: #404040;
        --card-bg: #242424;
        --input-bg: #2d2d2d;
        --input-border: #404040;
        --button-bg: #dc3545;
        --button-hover: #e84855;
        --button-text: #ffffff;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Form Card */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px var(--shadow);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--button-bg);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--button-bg);
    color: var(--button-text);
    width: 100%;
}

.btn-primary:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Validation */
.text-danger {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.validation-summary-errors {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-summary-errors li {
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.validation-summary-errors li:last-child {
    margin-bottom: 0;
}

/* Input States */
.input-validation-error {
    border-color: #dc3545 !important;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
}

/* Text Paragraph in Forms */
.form-group p {
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 1.25rem;
    }
}

/* Loading/Transition States */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

/* reCAPTCHA Container */
.form-group > div[id^="recaptcha"] {
    margin: 0.5rem 0;
}

/* Stats Display */
.stats-status,
.stats-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
}

/* Mobile Responsive Stats */
@media (max-width: 768px) {
    .stats-status,
    .stats-number {
        font-size: 30px;
    }
}