
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
.guide-container{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    background: #fff; 
    justify-content: center;
    overflow: auto !important; 
    -webkit-overflow-scrolling: touch;
}

.guide-modal {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    box-shadow: 0 8px 40px rgba(0,0,0,.14);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 40px;
    width: 100%;
    border-bottom: 1px solid #e8e8e8;
}

.navbar-brand {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
}

.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.btn-close:hover { background: #f0f0f0; }
.btn-close svg { 
    width: 30px; 
    height: 30px; 
    stroke: currentColor; 
    stroke-width: 2.5; 
}

.modal-body {
    display: flex;
    height: 80vh;
    position: relative;
    overflow: hidden;
}

.btn-skip {
    position: absolute;
    top: 10px;
    right: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: #4a7cf7;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .01em;
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 10;
}
.btn-skip:hover { 
    background: #eef3ff; 
}

.slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .38s cubic-bezier(.45,.05,.15,1);
}

.slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 50px;
    margin: 20px 0;
}

/* Illustration image */
.illustration {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.illustration img {
    max-width: 600px;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    align-self: center;
}

/* Fallback placeholder shown when src is empty / broken */
.illustration img[src=""],
.illustration img:not([src]) {
    display: none;
}
.illustration .img-placeholder {
    width: 100%;
    height: 100%;
    background: #f4f4f6;
    border: 2px dashed #d0d0d8;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #aaa;
    font-size: 13px;
}
.illustration .img-placeholder svg {
    width: 36px;
    height: 36px;
    stroke: #ccc;
    stroke-width: 1.5;
    fill: none;
}

.caption {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    color: #1a1a1a;
    line-height: 1.5;
}
.caption-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #1a1a1a;
}
.caption-text {
    font-size: 19px;
    letter-spacing: 1px;
    font-weight: 400;
}

.modal-footer {
    height: 15vh;
    padding: 0 50px 22px;
}

.dots {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d4d4d8;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}
.dot.active { background: #c47f17; transform: scale(1.2); }
.dot:hover:not(.active) { background: #a1a1aa; }

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.btn {
    border: 1px solid #c47f17;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    height: 40px;
    width: 130px;
    transition: background .18s, opacity .18s, transform .1s;
    letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-prev {
    background: transparent;
    border: 1.5px solid #c47f17;
    color: #555;
}
.btn-prev:hover:not(:disabled) { background: #f5f5f7; }
.btn-prev:disabled { opacity: .4; cursor: default; }

.btn-next { background: #c47f17; color: #fff; }
.btn-next:hover { background: #b0710f; }
.btn-next.finish { background: #2a9d6e; border: 1px solid #2a9d6e; }
.btn-next.finish:hover { background: #218a5e; }

.progress-bar { height: 3px; background: #f0f0f0; width: 100%; }
.progress-fill {
    height: 100%;
    background: #c47f17;
    transition: width .38s ease;
    border-radius: 0 2px 2px 0;
}
.progress-fill.finish { background: #2a9d6e; }


@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.slide .illustration,
.slide .caption { 
    animation: fadeUp .35s ease both; 
}
.slide .caption  { 
    animation-delay: .06s; 
}


/* ── Page wrapper ── */
.page-wrapper {
    position: relative;
    width: 100%;
    display: none;

    min-height: 100vh;
    flex-direction: column;

    align-items: center;
}

.page {
    position: relative;
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Close button */
.start-btn-close {
    position: absolute;
    top: 22px;
    right: 22px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #222;
    line-height: 1;
    padding: 4px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 32px;
    letter-spacing: -.5px;
}

.picker-area {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 600px;
    height: 580px;
    position: relative;
}

/* ── Ruler column ── */
.ruler-col {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    position: relative;
    height: 100%;
    flex-shrink: 0;
}

/* tick labels */
.ruler-labels {
    display: flex;
    flex-direction: column-reverse;  /* 0 at bottom, 7 at top */
    justify-content: space-between;
    height: 100%;
    padding: 0;
    margin-right: 4px;
}
.ruler-labels span {
    font-size: 12px;
    color: #888;
    text-align: right;
    line-height: 1;
    white-space: nowrap;
}

/* The ruler bar itself */
.ruler-bar {
    position: relative;
    width: 20px;
    height: 100%;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: visible;
    flex-shrink: 0;
}

/* filled portion (amber, from bottom up) */
.ruler-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #c47f17;
    cursor: pointer;
    border-radius: 4px;
    transition: height .05s linear;
}

/* tick marks on the ruler */
.ruler-ticks {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ── Drag handle ── */
.handle {
    position: absolute;
    left: 0;
    width: 44px;
    height: 20px;
    background: #c47f17;
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(196,127,23,.35);
    /* vertically centred on the fill top */
    transform: translateY(50%);
}
.handle:active { cursor: grabbing; }
.handle-grip {
    width: 14px;
    height: 3px;
    border-top: 1.5px solid rgba(255,255,255,.7);
    border-bottom: 1.5px solid rgba(255,255,255,.7);
}

/* ── Figure column ── */
.figure-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-left: 4px;
    padding-bottom: 4px;
    flex: 1;
    position: relative;
}

/* height label above figure */
#height-header {
    font-size: 26px;
    letter-spacing: 2px;
    padding-top: 10px;
}
.height-label {
    font-size: 26px;
    font-weight: 500;
    color: #111;
    letter-spacing: 1px;
    margin-bottom: 8px;
    line-height: 1;
    transition: none;
}

.person-img {
    object-fit: contain;
    object-position: bottom center;
    display: block;
    /* height scales with the slider value */
    transition: height .05s linear;
    max-width: 600px;

}
.bottom-div {
    margin-top: 20px;
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drag-hint {
    font-size: 14px;
    color: #aaa;
}
.btnSubmit {
    width: 90%;
    padding: 12px;
    background: #fff;
    border: 1.5px solid #ddd;
    font-size: 17px;
    color: #aaa;
    cursor: pointer;
    font-weight: 500;
}
.btnSubmit.active {
    border-color: #c47f17;
    background: #c47f17;
    color: #fff;
}
.btnSubmit.active:hover { background: #fff; color: #c47f17; }

#guide-loader {
    position: fixed;
    display: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    background: transparent;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
#guide-spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top-color: skyblue;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1000px) {
    .modal-body {
        height: 72vh
    }
}
@media (max-width: 520px) {
    .page { padding: 15px 10px; }
    .picker-area { height: 500px; }
    .ruler-bar { width: 15px; }
    h1 { font-size: 23px; }
    .height-label { font-size: 20px;}
    .handle {
        width: 34px;
        height: 15px;
    }
    .btnSubmit {
        width: 75%;
        padding: 10px;
        font-size: 15px;
    }
    .start-btn-close {
        top: 15px;
        right: 10px;
    }

    #height-header {
        font-size: 22px;
        letter-spacing: 1px;
        padding-top: 1px;
    }
    /* Modal Media Query */
    .modal-header {
        padding: 0 10px;
    }
    .btn-skip {
        right: 5px
    }
    .slide { 
        margin: 5px 0;
        padding: 0 10px;
        align-items: center;
        column-gap: 15px;
    }
    .illustration img {
        max-width: 320px;
        max-height: 350px;
        margin-bottom: 15px;
    }

    .caption {
        align-items: flex-start;
        gap: 5px;
        color: #1a1a1a;
        line-height: 1;
        margin-bottom: 5px;
    }
    .caption-dot {
        width: 8px;
        height: 8px;
        margin-top: 4px;
    }
    .caption-text {
        font-size: 16px;
        letter-spacing: 0.5px;
        font-weight: 400;
    }

    .modal-footer {
        display: flex;
        position: relative;
        align-items: center;
        padding: 0 10px;
    }
    .footer-inner { height: 100%; }
    .dots { top: 1px; }
    .dot {
        width: 8px;
        height: 8px;
    }
    .btn {
        height: 35px;
        width: 120px;
        font-size: 14px
    }
}

/*Camera Selection Page */
.camera-container {
    width: 100%;
    min-height: 100dvh;
    display: none;
    flex-direction: column;
    align-items: center;
}
.camera-page {
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0 0 0;
    position: relative;
    gap: 30px;
}

.camera-option h1 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}

.camera-option {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.camera-label { 
    font-size: 16px; 
    color: #111; 
    font-weight: 400; 
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 1px;
}
.camera-label.active { font-weight: 700; }
.phone-canvas { display: block; }

.check-badge {
    position: absolute;
    bottom: 34px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2ecc71;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .2s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
    z-index: 10;
}
.check-badge.visible { opacity: 1; transform: scale(1); }
.check-badge svg {
    width: 20px; height: 20px;
    stroke: #fff; stroke-width: 3;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.btn-camera {
    width: 280px;
    padding: 10px;
    background: #b07314;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 60px;
}
.btn-camera:hover  { background: #9a640f; }
.btn-camera:active { background: #845510; }

@media (max-width: 600px) {
    .btn-camera { margin-top: 30px; margin-bottom: 30px;}
    .camera-page { gap: 2px; }
}
