/* ============================================================
   Dawon i Tech — Query Form page styles
   Floating labels, checkbox chips, progress, animations.
   ============================================================ */

/* ---------- Floating label fields ---------- */
.fl-wrap {
    position: relative;
}

.fl-wrap input,
.fl-wrap select,
.fl-wrap textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.2rem 1rem 0.45rem;
    font-size: 0.95rem;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fl-wrap textarea {
    resize: vertical;
    min-height: 7.5rem;
}

.fl-wrap select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.fl-wrap label {
    position: absolute;
    left: 1rem;
    top: 0.95rem;
    font-size: 0.95rem;
    color: #64748b;
    pointer-events: none;
    z-index: 1;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease;
}

.fl-wrap input:focus,
.fl-wrap select:focus,
.fl-wrap textarea:focus {
    border-color: #e85442;
    box-shadow: 0 0 0 4px rgba(232, 84, 66, 0.12);
}

.fl-wrap input:focus ~ label,
.fl-wrap input:not(:placeholder-shown) ~ label,
.fl-wrap textarea:focus ~ label,
.fl-wrap textarea:not(:placeholder-shown) ~ label,
.fl-wrap select:focus ~ label,
.fl-wrap select.has-value ~ label {
    top: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #e85442;
}

/* ---------- Field errors ---------- */
.fl-wrap .field-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.err-msg {
    display: none;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: #dc2626;
    font-weight: 500;
}

.err-msg.show {
    display: block;
}

/* ---------- Checkbox chips ---------- */
.cb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.6rem;
}

.cb-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.cb-chip i {
    width: 1.15rem;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.cb-chip:hover {
    border-color: #f0a296;
    background: #fef6f5;
}

input.cb-input:checked + .cb-chip {
    border-color: #e85442;
    background: rgba(232, 84, 66, 0.08);
    color: #e85442;
}

input.cb-input:checked + .cb-chip i {
    color: #e85442;
}

input.cb-input:focus-visible + .cb-chip {
    outline: 2px solid #e85442;
    outline-offset: 2px;
}

/* ---------- Section card ---------- */
.sec-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.25rem;
    box-shadow: 0 10px 35px -12px rgba(0, 0, 0, 0.18);
    padding: 1.75rem;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.sec-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.sec-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #e85442, #f07462);
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow: 0 8px 20px -8px rgba(232, 84, 66, 0.7);
}

/* ---------- Progress indicator ---------- */
.qf-progress {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.2);
}

.qf-progress-track {
    height: 6px;
    background: #eef2f7;
    border-radius: 9999px;
    overflow: hidden;
}

.qf-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e85442, #f07462);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.qf-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.qf-step .num {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #eef2f7;
    color: #64748b;
    font-size: 0.72rem;
    transition: all 0.25s ease;
}

.qf-step.active {
    color: #e85442;
}

.qf-step.active .num {
    background: #e85442;
    color: #ffffff;
}

.qf-step.done .num {
    background: #22c55e;
    color: #ffffff;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #e85442;
    color: #ffffff;
    font-weight: 700;
    padding: 0.95rem 2rem;
    border-radius: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 28px -10px rgba(232, 84, 66, 0.7);
}

.btn-primary:hover {
    background: #cf4432;
    box-shadow: 0 16px 32px -10px rgba(232, 84, 66, 0.8);
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---------- Spinner ---------- */
.spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 9999px;
    animation: qf-spin 0.7s linear infinite;
    display: inline-block;
}

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

/* ---------- Success card ---------- */
.success-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.35);
}

.success-check {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.4rem;
    animation: qf-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 18px 40px -14px rgba(34, 197, 94, 0.7);
}

@keyframes qf-pop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes qf-rise {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.qf-rise {
    animation: qf-rise 0.6s ease both;
}

/* ---------- Hero blobs ---------- */
.blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(90px);
    pointer-events: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .sec-card,
    .qf-step,
    .qf-progress-fill {
        transition: none;
    }
    .sec-card {
        opacity: 1;
        transform: none;
    }
}
