/* Form Styles - Стили форм ТРОН */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--tron-text);
    font-size: 14px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tron-text);
    background-color: white;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    transition: all 0.3s ease;
    appearance: none;
}

.form-control:focus {
    border-color: var(--tron-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

.form-control:disabled {
    background-color: var(--tron-gray);
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--tron-dark-gray);
    opacity: 1;
}

/* Input Sizes */
.form-control-sm {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
}

.form-control-lg {
    padding: 16px 20px;
    font-size: 18px;
    border-radius: 10px;
}

/* Input States */
.form-control.is-valid {
    border-color: var(--tron-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.88 1.88L7.5 4.5l.94.94L4.12 10.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-control.is-invalid {
    border-color: var(--tron-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3cpath fill='%23dc3545' d='M6 0C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM9 8.5L8.5 9 6 6.5 3.5 9 3 8.5 5.5 6 3 3.5 3.5 3 6 5.5 8.5 3 9 3.5 6.5 6 9 8.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Validation Messages */
.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: var(--tron-success);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: var(--tron-danger);
}

/* Select */
.form-select {
    display: block;
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tron-text);
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    transition: all 0.3s ease;
    appearance: none;
}

.form-select:focus {
    border-color: var(--tron-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

/* Textarea */
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    appearance: none;
    border: 2px solid #E5E5E5;
    border-radius: 4px;
    background-color: white;
    transition: all 0.3s ease;
    position: relative;
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--tron-blue);
    border-color: var(--tron-blue);
}

.form-check-input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.form-check-input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

.form-check-label {
    font-size: 16px;
    color: var(--tron-text);
    cursor: pointer;
    user-select: none;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Switch */
.form-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.form-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.form-switch input:checked + .form-switch-slider {
    background-color: var(--tron-blue);
}

.form-switch input:checked + .form-switch-slider:before {
    transform: translateX(26px);
}

/* File Input */
.form-file {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.form-file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.form-file-label {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--tron-gray);
    border: 2px dashed #E5E5E5;
    border-radius: 8px;
    color: var(--tron-text);
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
}

.form-file:hover .form-file-label {
    background-color: var(--tron-light-blue);
    border-color: var(--tron-blue);
    color: var(--tron-blue);
}

.form-file-input:focus + .form-file-label {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tron-text);
    text-align: center;
    white-space: nowrap;
    background-color: var(--tron-gray);
    border: 2px solid #E5E5E5;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    border-radius: 0 8px 8px 0;
    border-left: 0;
}

.input-group .form-control:focus {
    z-index: 3;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
    padding: 1rem 0.75rem;
}

.form-floating .form-control::placeholder {
    color: transparent;
}

.form-floating .form-control:focus,
.form-floating .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--tron-dark-gray);
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--tron-blue);
}

/* Search Form */
.search-form {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-form .form-control {
    padding-left: 50px;
    border-radius: 25px;
    border: 2px solid #E5E5E5;
}

.search-form .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tron-dark-gray);
    font-size: 18px;
    pointer-events: none;
}

/* Contact Form */
.contact-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form .form-label {
    font-size: 16px;
    margin-bottom: 10px;
}

.contact-form .form-control {
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 10px;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
}

.newsletter-form .form-control {
    flex: 1;
    border-radius: 25px;
    border: 2px solid #E5E5E5;
}

.newsletter-form .btn {
    border-radius: 25px;
    padding: 12px 30px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .contact-form {
        padding: 20px;
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group-text {
        border-radius: 8px 8px 0 0;
    }
    
    .input-group .form-control {
        border-radius: 0 0 8px 8px;
        border-top: 0;
        border-left: 2px solid #E5E5E5;
    }
}