/**
 * CSS Form Styles - Professional Form Styling Library
 * @author Gabriel Demetrios Lafis
 * Comprehensive form components with modern design
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --error-color: #dc3545;
    --border-radius: 8px;
    --input-padding: 12px 16px;
    --transition-speed: 0.3s;
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1, h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* ===== Form Groups ===== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* ===== Text Inputs ===== */
.form-input {
    width: 100%;
    padding: var(--input-padding);
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== Validation States ===== */
.form-input.valid {
    border-color: var(--success-color);
}

.form-input.invalid {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

.success-message {
    color: var(--success-color);
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* ===== Select Dropdowns ===== */
.form-select {
    width: 100%;
    padding: var(--input-padding);
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== Checkboxes & Radio Buttons ===== */
.checkbox-wrapper,
.radio-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.checkbox-wrapper input[type="checkbox"],
.radio-wrapper input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-wrapper label,
.radio-wrapper label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button Variations */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

/* ===== Textarea ===== */
textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ===== File Input ===== */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: block;
    padding: var(--input-padding);
    border: 2px dashed #e1e5e9;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-speed) ease;
}

.file-input-label:hover {
    border-color: var(--primary-color);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .btn {
        width: 100%;
    }
}

/* ===== Focus Visible (Accessibility) ===== */
.form-input:focus-visible,
.form-select:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Author Credit ===== */
.author {
    margin-top: 40px;
    text-align: center;
    font-style: italic;
    opacity: 0.7;
    font-size: 14px;
}
