/**
 * Единые стили форм для всего проекта
 * Этап 1.3: Формы
 * 
 * Использованы лучшие стили:
 * - Стиль: из Messenger/Groups
 * - Focus glow: rgba(6, 182, 212, 0.1)
 */

/* ==================== БАЗОВЫЕ СТИЛИ ПОЛЕЙ ==================== */

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== PLACEHOLDER СТИЛИ ==================== */

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.form-input:-ms-input-placeholder,
.form-textarea:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input::-ms-input-placeholder,
.form-textarea::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ==================== TEXTAREA ==================== */

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-textarea-sm {
    min-height: 80px;
}

.form-textarea-lg {
    min-height: 200px;
}

/* ==================== SELECT ==================== */

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 45px;
    cursor: pointer;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2306b6d4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* ==================== CHECKBOX И RADIO ==================== */

.form-checkbox,
.form-radio {
    width: 20px;
    height: 20px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    border-color: transparent;
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.form-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.form-checkbox:focus,
.form-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* ==================== LABEL ==================== */

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-label-required::after {
    content: ' *';
    color: #ef4444;
}

.form-label-sm {
    font-size: 0.875rem;
}

.form-label-lg {
    font-size: 1rem;
}

/* ==================== ГРУППЫ ПОЛЕЙ ==================== */

.form-group {
    margin-bottom: 20px;
}

.form-group-sm {
    margin-bottom: 12px;
}

.form-group-lg {
    margin-bottom: 28px;
}

/* ==================== ОШИБКИ ==================== */

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: #ef4444;
}

.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ==================== УСПЕХ ==================== */

.form-input.success,
.form-textarea.success,
.form-select.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-success {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: #10b981;
}

/* ==================== HELP TEXT ==================== */

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== РАЗМЕРЫ ==================== */

.form-input-sm,
.form-select-sm {
    padding: 10px 14px;
    font-size: 0.875rem;
}

.form-input-lg,
.form-select-lg {
    padding: 18px 22px;
    font-size: 1.05rem;
}

/* ==================== INPUT GROUP ==================== */

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-input,
.input-group .form-select {
    border-radius: 0;
    border-right: none;
}

.input-group .form-input:first-child,
.input-group .form-select:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.input-group .form-input:last-child,
.input-group .form-select:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.input-group-addon:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-right: none;
}

.input-group-addon:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-left: none;
}

/* ==================== АДАПТИВНОСТЬ ==================== */

@media (max-width: 768px) {
    .form-input,
    .form-textarea,
    .form-select {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.875rem;
    }
}

