/* Wizard Container */
.wizard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Progress Bar */
.wizard-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
    padding: 0 20px;
}

/* Gray line behind steps */
.wizard-progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
    transform: translateY(-50%);
    border-radius: 2px;
}

.wizard-progress-step {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.wizard-progress-step.active {
    border-color: #5C2D91;
    background: #5C2D91;
    color: white;
    box-shadow: 0 0 0 4px rgba(92, 45, 145, 0.2);
}

.wizard-progress-step.completed {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

/* Labels for steps */
.step-label {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.wizard-progress-step.active .step-label {
    color: #5C2D91;
}

/* Step Content */
.wizard-step {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* IID Inputs */
.iid-blocks-container {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    /* Force single line */
    justify-content: center;
    margin: 20px 0;
    overflow-x: auto;
    /* Scroll if too narrow */
    padding-bottom: 8px;
    /* Space for scrollbar */
    -webkit-overflow-scrolling: touch;
}

.iid-block-input {
    width: 85px;
    /* Slightly smaller to fit 9 in row */
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 10px 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
    letter-spacing: 0px;
    flex-shrink: 0;
    /* Prevent squishing too much */
}

.iid-block-input:focus {
    border-color: #5C2D91;
    outline: none;
    box-shadow: 0 0 0 3px rgba(92, 45, 145, 0.1);
}

/* Mobile responsive for IID blocks - keep horizontal scroll */
@media (max-width: 600px) {
    .iid-blocks-container {
        justify-content: flex-start;
        /* Align start to scroll */
    }

    .iid-block-input {
        width: 80px;
        font-size: 14px;
    }
}

/* Copy Button Styling */
.btn-copy-all {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-copy-all:hover {
    background: #059669;
}

/* Error 0xc004c008 Helper Block */
.error-helper-block {
    background: #faf5ff;
    border: 2px solid #d8b4fe;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
    position: relative;
}

.error-helper-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #4c237e;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.nav-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.nav-tab.active {
    color: #5C2D91;
    border-bottom-color: #5C2D91;
}

.nav-tab:hover {
    color: #1e293b;
}

/* Confirmation Blocks */
.confirmation-block-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.confirmation-block-label {
    font-size: 14px;
    font-weight: 700;
    color: #5C2D91;
    text-align: center;
    text-transform: uppercase;
}

.confirmation-block {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    color: #1e293b;
    font-family: "Courier New", monospace;
    font-size: 18px;
    transition: all 0.2s ease;
    user-select: all;
    min-width: 80px;
}

.confirmation-block:hover {
    border-color: #5C2D91;
    background: #f8fafc;
}

.confirmation-block.active-copy {
    background-color: #5C2D91 !important;
    border-color: #5C2D91 !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

/* Result Card Clean Style */
.result-card-clean {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.result-card-clean h3 {
    color: #1e293b !important;
}

/* Force single line for confirmation results */
#confirmationCodeBlocks {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: center;
}

@media (max-width: 600px) {
    #confirmationCodeBlocks {
        justify-content: center !important;
        flex-wrap: wrap !important;
        overflow-x: visible;
        gap: 12px !important;
    }

    #confirmationCodeBlocks .confirmation-block-wrapper {
        flex: 0 0 calc(50% - 8px) !important;
        min-width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
    }

    #confirmationCodeBlocks .confirmation-block {
        width: 100%;
        font-size: 16px;
        padding: 10px 6px;
    }

    #confirmationCodeBlocks .confirmation-block-label {
        font-size: 13px;
    }
}

/* Mobile input field fixes */
@media (max-width: 768px) {
    .professional-input {
        font-size: 16px !important;
        padding: 12px 16px !important;
        letter-spacing: 0 !important;
    }

    .professional-input::placeholder {
        font-size: 14px !important;
        white-space: nowrap;
        overflow: visible;
    }

    /* Token input on step 1 */
    #tokenInput {
        font-size: 18px !important;
        letter-spacing: 1px !important;
    }

    #tokenInput::placeholder {
        font-size: 14px !important;
    }

    /* Key display on step 2 - restructure for mobile */
    #wizardKeyDisplay {
        font-size: 13px !important;
        padding: 12px 10px !important;
        padding-right: 10px !important;
        text-align: center;
    }

    /* Copy button - make it full width and taller on mobile */
    #copyKeyButton {
        position: static !important;
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        margin-top: 12px !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
    }

    /* Wrap the key input container for mobile layout */
    #key-section .input-group>div {
        display: flex;
        flex-direction: column;
    }

    /* "Я получил ID установки" button - slightly smaller */
    #step2Next {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    #step2Next span {
        font-size: 14px !important;
    }

    /* Step titles */
    .step-title-large {
        font-size: 16px !important;
        line-height: 1.3;
    }

    .step-header {
        gap: 12px;
    }

    .step-icon-circle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    /* Professional card padding */
    .professional-card {
        padding: 16px !important;
    }

    /* Wizard container */
    .wizard-container {
        padding: 10px !important;
    }

    /* IID blocks container - 2 rows for mobile */
    .iid-blocks-container {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px !important;
        overflow-x: visible !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .iid-block-input {
        width: 100% !important;
        min-width: 55px !important;
        max-width: none !important;
        font-size: 13px !important;
        padding: 10px 4px !important;
    }
}

/* Wizard Back Button */
.btn-wizard-back {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #64748b;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-wizard-back:hover {
    border-color: #cbd5e1;
    color: #1e293b;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-wizard-back:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 768px) {
    .btn-wizard-back {
        width: 100%;
        padding: 14px 20px;
    }
}