:root {
    --ty-primary: #2271b1;
    --ty-primary-hover: #1a5a8a;
    --ty-primary-light: rgba(34, 113, 177, 0.1);
}

.ty-form-container[data-theme="blue"] {
    --ty-primary: #2271b1;
    --ty-primary-hover: #1a5a8a;
    --ty-primary-light: rgba(34, 113, 177, 0.1);
}

.ty-form-container[data-theme="green"] {
    --ty-primary: #16a34a;
    --ty-primary-hover: #15803d;
    --ty-primary-light: rgba(22, 163, 74, 0.1);
}

.ty-form-container[data-theme="purple"] {
    --ty-primary: #9333ea;
    --ty-primary-hover: #7e22ce;
    --ty-primary-light: rgba(147, 51, 234, 0.1);
}

.ty-form-container[data-theme="red"] {
    --ty-primary: #dc2626;
    --ty-primary-hover: #b91c1c;
    --ty-primary-light: rgba(220, 38, 38, 0.1);
}

.ty-form-container[data-theme="orange"] {
    --ty-primary: #ea580c;
    --ty-primary-hover: #c2410c;
    --ty-primary-light: rgba(234, 88, 12, 0.1);
}

.ty-form-container[data-theme="gray"] {
    --ty-primary: #374151;
    --ty-primary-hover: #1f2937;
    --ty-primary-light: rgba(55, 65, 81, 0.1);
}

.ty-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ty-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.ty-form-title {
    font-size: 28px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.ty-form-description {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.ty-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ty-form-group {
    display: flex;
    flex-direction: column;
}

.ty-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ty-required {
    color: #e74c3c;
}

.ty-input,
.ty-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}

.ty-input:focus,
.ty-textarea:focus {
    outline: none;
    border-color: var(--ty-primary);
    box-shadow: 0 0 0 3px var(--ty-primary-light);
}

.ty-textarea {
    resize: vertical;
    min-height: 100px;
}

.ty-services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ty-services-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #6b7280;
}

.ty-service-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.ty-service-checkbox-row {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 14px;
}

.ty-service-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--ty-primary);
    flex-shrink: 0;
}

.ty-service-checkbox-row label {
    flex: 1;
    cursor: pointer;
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    margin: 0;
}

.ty-accordion-btn {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 6px 12px;
    border: none;
    text-align: center;
    outline: none;
    font-size: 14px;
    transition: 0.3s;
    border-radius: 4px;
    flex-shrink: 0;
}

.ty-accordion-btn:hover {
    background-color: #ccc;
}

.ty-panel {
    padding: 0 12px 12px 12px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.ty-panel p {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.ty-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.ty-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--ty-primary);
}

.ty-checkbox-label a {
    color: var(--ty-primary);
    text-decoration: none;
}

.ty-checkbox-label a:hover {
    text-decoration: underline;
}

.ty-phone-counter {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
}

.ty-phone-counter span {
    transition: color 0.3s ease;
}

.ty-form-messages {
    margin: 10px 0;
}

.ty-message {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ty-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ty-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ty-message-icon {
    font-size: 20px;
    font-weight: bold;
}

.ty-message-text {
    flex: 1;
}

.ty-submit-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    background: var(--ty-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    position: relative;
}

.ty-submit-button:hover:not(:disabled) {
    background: var(--ty-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--ty-primary-light);
}

.ty-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.ty-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ty-submit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ty-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media screen and (max-width: 768px) {
    .ty-form-container {
        margin: 20px 15px;
        padding: 20px;
    }

    .ty-form-title {
        font-size: 24px;
    }

    .ty-form-description {
        font-size: 14px;
    }

    .ty-submit-button {
        font-size: 16px;
        padding: 12px 20px;
    }

    .ty-service-checkbox-row {
        padding: 10px;
    }
}
