/**
 * Native form styles for JCTY theme.
 * Applied to contact form, inquiry form, ticket form, newsletter.
 *
 * @package JCTY
 */

/* Form container */
.jcty-form {
    max-width: 720px;
}

.jcty-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.jcty-form__field {
    margin-bottom: 20px;
}

.jcty-form__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a2e);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.jcty-form__field label span {
    color: var(--color-accent, #FF6B35);
}

.jcty-form__field input,
.jcty-form__field select,
.jcty-form__field textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--color-text-primary, #1a1a2e);
    background: var(--color-bg-input, #f8f9fa);
    border: 1px solid var(--color-border, rgba(0,0,0,0.1));
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.jcty-form__field input:focus,
.jcty-form__field select:focus,
.jcty-form__field textarea:focus {
    border-color: var(--color-primary, #0066FF);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.jcty-form__field textarea {
    resize: vertical;
    min-height: 120px;
}

.jcty-form__field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Form actions */
.jcty-form__actions {
    margin-top: 8px;
}

.jcty-form__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Status messages */
.jcty-form__status {
    margin-top: 16px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
}

.jcty-form__status:empty {
    display: none;
}

.jcty-form__status--success {
    display: block;
    padding: 14px 20px;
    color: #0d6932;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.jcty-form__status--error {
    display: block;
    padding: 14px 20px;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Loading state */
.btn--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn--loading::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: jcty-spin 0.6s linear infinite;
}

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

/* Inquiry modal */
.inquiry-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.inquiry-modal.is-open {
    display: flex;
}

.inquiry-modal__content {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.inquiry-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.inquiry-modal__close:hover {
    background: #e5e5e5;
}

.inquiry-modal__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.inquiry-modal__product {
    font-size: 14px;
    color: var(--color-text-muted, #666);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

/* Newsletter form (footer) */
.newsletter-form {
    display: flex;
    gap: 8px;
    max-width: 400px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    outline: none;
}

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

.newsletter-form input:focus {
    border-color: var(--color-primary, #0066FF);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.newsletter-form button {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .jcty-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .inquiry-modal__content {
        padding: 28px 20px;
    }

    .newsletter-form {
        flex-direction: column;
    }
}
