/* ============================================================
   DEVICE MODAL ENHANCED CSS · STV BOX Pro
   Mobile-first · Ionic Web Components
============================================================ */

/* ===================== GLOBAL ===================== */
.hidden {
    display: none !important;
}

/* ===================== STEP INDICATOR ===================== */
.modal-step {
    flex: 1;
    text-align: center;
    opacity: .35;
    transition: all .3s ease;
}

.modal-step.active {
    opacity: 1;
}

.modal-step.completed {
    opacity: .75;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #6B7280;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
}

.modal-step.active .step-number {
    background: linear-gradient(135deg, #9FEC53, #7AD63A);
    color: #064E3B;
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(159,236,83,.45);
}

.modal-step.completed .step-number {
    background: #22C55E;
    color: #fff;
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: #9CA3AF;
}

.modal-step.active .step-label {
    color: #064E3B;
}

/* ===================== STEP 2 CARD ===================== */
.step-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px 16px 10px;
    box-shadow:
            0 10px 30px rgba(0,0,0,.08),
            0 2px 6px rgba(0,0,0,.04);
    margin-bottom: 24px;
}

.step-title {
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    color: #0F172A;
}

/* ===================== INPUT STYLE ===================== */
.input-item {
    --background: #F8FAFC;
    border-radius: 14px;
    border: none;
    margin-bottom: 14px;
    padding: 6px 10px;
    box-shadow: inset 0 0 0 1px #E5E7EB;
    transition: all .25s ease;
}

.input-item ion-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-item ion-icon {
    font-size: 16px;
    color: #9FEC53;
}

.input-item:focus-within {
    background: #ffffff;
    box-shadow:
            0 0 0 2px rgba(159,236,83,.45),
            0 8px 20px rgba(159,236,83,.15);
}

/* ===================== INPUT TEXT ===================== */
ion-input,
ion-select,
ion-textarea {
    font-size: 15px;
    font-weight: 600;
    color: #0F172A;
}

/* Fix select viền xanh to */
ion-select::part(container) {
    border: none !important;
    box-shadow: none !important;
}

/* ===================== FORM BLOCK ===================== */
.form-block {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 16px;
}

.form-block-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #0F172A;
}

/* ===================== DEVICE TYPE ===================== */
.device-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.device-type-card {
    border-radius: 18px;
    border: 2px solid #E5E7EB;
    padding: 20px 14px;
    text-align: center;
    background: #fff;
    transition: all .25s ease;
}

.device-type-card:active {
    transform: scale(.97);
}

.device-type-card.selected {
    border-color: #9FEC53;
    background: linear-gradient(135deg, #F1FEE7, #E8F9E8);
    box-shadow: 0 8px 24px rgba(159,236,83,.35);
}

.device-type-icon {
    font-size: 48px;
    margin-bottom: 6px;
}

.device-type-name {
    font-weight: 800;
    font-size: 15px;
}

.device-type-desc {
    font-size: 12px;
    color: #64748B;
}

/* ===================== DEVICE PREVIEW ===================== */
.device-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #F1FEE7, #E8F9E8);
    box-shadow: 0 6px 20px rgba(159,236,83,.35);
    margin-bottom: 18px;
}

.preview-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #9FEC53;
    color: #064E3B;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-info {
    flex: 1;
}

.preview-name {
    font-size: 16px;
    font-weight: 800;
}

.preview-meta {
    font-size: 12px;
    color: #14532D;
}

.preview-flags {
    display: flex;
    gap: 6px;
    font-size: 18px;
}

/* ===================== PC TEST ===================== */
.pc-test-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.pc-test-result.success {
    background: #DCFCE7;
    color: #166534;
}

.pc-test-result.error {
    background: #FEE2E2;
    color: #7F1D1D;
}

/* ===================== SUCCESS VIEW ===================== */
.modal-success {
    text-align: center;
    padding: 40px 20px;
    animation: fadeScaleIn .35s ease;
}

.success-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: successPop .6s ease;
}

.modal-success h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-success p {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 24px;
}

@keyframes fadeScaleIn {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes successPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===================== NEXT BUTTON ===================== */
#modal-next-btn {
    height: 52px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 16px;
    background: linear-gradient(135deg, #9FEC53, #7AD63A);
    color: #064E3B;
    box-shadow: 0 10px 24px rgba(159,236,83,.45);
}

#modal-next-btn:active {
    transform: scale(.97);
}

/* ===================== MOBILE ===================== */
@media (max-width: 420px) {
    .device-type-grid {
        grid-template-columns: 1fr;
    }

    .preview-name {
        font-size: 15px;
    }
}
