/**
 * YIO Contact Form Styles
 *
 * @package YIO
 * @version 3.0.0
 */

.yio-contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.yio-contact-form-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.yio-contact-form {
    width: 100%;
}

/* ============================================
   Type Selector Cards
   ============================================ */

.yio-type-selector-label {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin-bottom: 16px;
    text-align: center;
}

.yio-type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.yio-type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    font-family: inherit;
    outline: none;
}

.yio-type-card:hover {
    border-color: #999;
    background: #f5f5f5;
}

.yio-type-card:focus-visible {
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

.yio-type-card.active {
    border-color: #2c3e50;
    background: #f0f4f8;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.yio-type-card-label {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    display: block;
}

.yio-type-card-desc {
    font-size: 13px;
    font-weight: 400;
    color: #777;
    display: block;
    line-height: 1.3;
}

/* Collapsed state when type is selected */
.yio-type-selected .yio-type-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.yio-type-selected .yio-type-card {
    padding: 8px 12px;
}

.yio-type-selected .yio-type-card:not(.active) {
    opacity: 0.5;
}

.yio-type-selected .yio-type-card-desc {
    display: none;
}

.yio-type-selected .yio-type-card-label {
    font-size: 13px;
    margin-bottom: 0;
}

/* ============================================
   Form Fields
   ============================================ */

.yio-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.yio-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.yio-form-group label .required {
    color: #e74c3c;
}

.yio-file-hint {
    font-weight: 400;
    font-size: 12px;
    color: #999;
}

.yio-form-group input[type="text"],
.yio-form-group input[type="email"],
.yio-form-group input[type="url"],
.yio-form-group select,
.yio-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.yio-form-group input[type="text"]:focus,
.yio-form-group input[type="email"]:focus,
.yio-form-group input[type="url"]:focus,
.yio-form-group select:focus,
.yio-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.yio-form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.yio-form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    cursor: pointer;
}

.yio-form-group input[type="file"]:hover {
    border-color: #999;
    background: #f5f5f5;
}

.yio-form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* Conditional field animation */
.yio-conditional-field {
    animation: yioFieldFadeIn 0.3s ease;
}

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

/* ============================================
   Form Actions
   ============================================ */

.yio-form-actions {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.yio-back-btn {
    display: inline-block;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.yio-back-btn:hover {
    background-color: #e5e5e5;
    color: #333;
}

.yio-submit-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #2c3e50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.yio-submit-btn:hover {
    background-color: #34495e;
}

.yio-submit-btn:active {
    transform: translateY(1px);
}

.yio-submit-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   Messages
   ============================================ */

.yio-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
}

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

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .yio-contact-form-wrapper {
        padding: 20px;
    }

    .yio-type-cards {
        grid-template-columns: 1fr;
    }

    .yio-type-selected .yio-type-cards {
        grid-template-columns: 1fr 1fr;
    }

    .yio-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .yio-form-actions {
        flex-direction: column-reverse;
    }

    .yio-submit-btn,
    .yio-back-btn {
        width: 100%;
        text-align: center;
    }

    .yio-submit-btn {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .yio-type-selected .yio-type-cards {
        grid-template-columns: 1fr;
    }

    .yio-type-card {
        padding: 12px 14px;
    }
}
