/* INSTRUCTIONS PAGE */

.instructions-header {
    text-align: center;
    margin-bottom: 30px;
}

.instructions-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #22c55e;
}

.instructions-header p {
    font-size: 16px;
    opacity: 0.7;
    margin: 0;
}

/* Segment Control */

.segment-wrap {
    margin-bottom: 30px;
}

.segment-control {
    display: flex;
    background: #0b0f0d;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #1f2a25;
    max-width: 400px;
    margin: 0 auto;
}

.segment-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #f5f5f5;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.segment-btn:hover {
    color: #22c55e !important;
}

.segment-btn.active {
    background: #22c55e !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

/* Instructions Content */

.instructions-content {
    margin-top: 20px;
    width: min(70%, 860px);
    margin-left: auto;
    margin-right: auto;
}

.instruction-card {
    background: #0b0f0d;
    border: 1px solid #1f2a25;
    border-radius: 12px;
    padding: 25px;
    width: 100%;
    max-width: none;
    margin: 0;
}

.instruction-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #22c55e;
    text-align: center;
}

.instruction-toggle {
    display: block;
    width: fit-content;
    margin: 0 auto 18px auto;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px dashed #22c55e;
    background: transparent;
    color: #22c55e;
    cursor: pointer;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.instruction-toggle:hover {
    background: #22c55e14;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.14);
    transform: translateY(-1px);
}

.instruction-toggle.expanded {
    background: #22c55e14;
    border-style: solid;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.18);
}

.instruction-toggle:active {
    transform: scale(0.98);
}

.instruction-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: instruction-step;
}

.instruction-list > li {
    position: relative;
    padding-left: 42px;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
    opacity: 0.9;
    counter-increment: instruction-step;
}

.instruction-list > li::before {
    content: counter(instruction-step) ".";
    position: absolute;
    left: 0;
    top: 0;
    color: #22c55e;
    font-weight: 700;
}

.instruction-list > li:last-child {
    margin-bottom: 0;
}

.instruction-step-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.instruction-step-text {
    display: block;
    max-width: 720px;
}

.instruction-link {
    color: #22c55e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.instruction-link:hover {
    color: #4ade80;
}

.instruction-image-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

.instruction-image-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.instruction-step-image {
    display: block;
    width: auto !important;
    max-width: min(100%, 220px) !important;
    height: auto !important;
    max-height: 320px;
    border-radius: 12px;
    border: 1px solid #1f2a25;
    background: #050806;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    transition:
        max-width 0.25s ease,
        max-height 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.instruction-image-button:hover .instruction-step-image {
    transform: translateY(-1px);
}

.instruction-step-image.expanded {
    max-width: min(100%, 520px) !important;
    max-height: 720px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.instruction-sublist {
    margin-top: 10px;
    padding-left: 20px;
    list-style: disc;
}

.instruction-sublist li {
    margin-bottom: 6px;
}

.instruction-list > li.ios-store-step {
    margin-left: 12px;
    padding-left: 42px;
    padding-top: 2px;
    padding-bottom: 10px;
    border-left: 2px solid rgba(34, 197, 94, 0.55);
    transition:
        max-height 0.3s ease,
        opacity 0.25s ease,
        margin-bottom 0.25s ease,
        padding-top 0.25s ease,
        padding-bottom 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
    transform-origin: top left;
}

.instruction-list > li.ios-store-step::before {
    left: 24px;
    transform: none;
}

.instruction-list > li.ios-store-step.expanded {
    max-height: 5000px;
    opacity: 0.95;
    margin-bottom: 0;
    transform: translateX(0);
}

.instruction-list > li.ios-store-step.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-left-color: rgba(34, 197, 94, 0);
    pointer-events: none;
    transform: translateX(-8px);
    counter-increment: none;
}

.instruction-list > li.ios-store-step.collapsed::before {
    content: "";
}

.instruction-list > li.ios-store-step + li.ios-store-step {
    margin-top: 0;
}

.instruction-list > li.ios-store-step.expanded + li:not(.ios-store-step) {
    margin-top: 18px;
}


/* TOP BAR */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    gap: 12px;
    flex-wrap: nowrap;
}

.top-bar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
    flex-wrap: nowrap;
}

.top-bar .iron-lang {
    margin-bottom: 0;
    align-items: center;
}

.btn-instructions {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #22c55e;
    background: transparent;
    color: #22c55e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-instructions:hover {
    background: #22c55e;
    color: white;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.btn-logout {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #ef4444;
    background: transparent;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-cabinet {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #22c55e;
    background: transparent;
    color: #22c55e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cabinet:hover {
    background: #22c55e;
    color: white;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

@media (max-width: 900px) {
    .instructions-content {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .instruction-card {
        padding: 20px 16px;
    }

    .instruction-list > li {
        padding-left: 34px;
    }

    .instruction-step-image {
        max-width: min(100%, 180px) !important;
        max-height: 260px;
    }

    .instruction-step-image.expanded {
        max-width: 100% !important;
        max-height: 520px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .top-bar-actions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        flex-wrap: wrap;
        width: 100%;
    }

    .top-bar-actions button {
        min-width: 0;
        flex: 1 1 0;
        max-width: calc(50% - 4px);
        white-space: normal;
        padding: 6px 10px;
        font-size: 12px;
        line-height: 1.3;
        text-align: center;
    }

    .btn-cabinet,
    .btn-logout {
        padding: 6px 10px;
        font-size: 12px;
    }
}
