.id-photo-body {
    min-height: 100vh;
    background: #f3f7fb;
}

.id-photo-app {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 18px 38px;
}

.id-photo-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: max(18px, env(safe-area-inset-top)) 0 18px;
}

.id-photo-back {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: #26364a;
    background: #fff;
    border: 1px solid #dfe7f0;
    border-radius: 50%;
    text-decoration: none;
}

.id-photo-topbar h1 {
    color: #1d2b3e;
    font-size: 1.35rem;
    line-height: 1.25;
}

.id-photo-topbar p {
    margin-top: 3px;
    color: #718095;
    font-size: 0.8rem;
}

.id-photo-stage,
.processing-stage,
.result-stage {
    padding: 32px 22px;
    background: #fff;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(25, 55, 85, 0.08);
}

.upload-stage {
    margin-top: 30px;
    text-align: center;
}

.upload-portrait {
    display: grid;
    width: 124px;
    height: 156px;
    margin: 0 auto 24px;
    place-items: end center;
    overflow: hidden;
    color: #8eb8e9;
    background: #e8f3ff;
    border: 2px dashed #9ec8f4;
    border-radius: 62px 62px 8px 8px;
}

.upload-portrait i {
    font-size: 6.5rem;
    transform: translateY(8px);
}

.upload-stage h2,
.processing-stage h2 {
    color: #213249;
    font-size: 1.3rem;
}

.upload-stage p,
.processing-stage p {
    margin: 9px auto 24px;
    color: #7c8999;
    font-size: 0.88rem;
    line-height: 1.6;
}

.upload-stage input {
    display: none;
}

.main-action,
.sub-action {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
}

.main-action {
    color: #fff;
    background: #1677ff;
    border: 1px solid #1677ff;
    box-shadow: 0 7px 16px rgba(22, 119, 255, 0.22);
}

.sub-action {
    margin-top: 12px;
    color: #49627f;
    background: #fff;
    border: 1px solid #ccd8e5;
}

.privacy-line {
    margin-top: 22px;
    color: #218553;
    font-size: 0.78rem;
}

.privacy-line i {
    margin-right: 5px;
}

.processing-stage {
    margin-top: 30px;
    text-align: center;
}

.processing-photo {
    width: 154px;
    height: 196px;
    margin: 0 auto 22px;
    overflow: hidden;
    background: #eef3f8;
    border-radius: 6px;
}

.processing-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 18px;
    border: 3px solid #dcecff;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.result-stage {
    padding: 18px;
}

.result-preview {
    display: flex;
    min-height: 410px;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: hidden;
    background-color: #e8edf3;
    background-image:
        linear-gradient(45deg, #dce3eb 25%, transparent 25%),
        linear-gradient(-45deg, #dce3eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dce3eb 75%),
        linear-gradient(-45deg, transparent 75%, #dce3eb 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    border-radius: 6px;
}

#photoCanvas {
    display: block;
    max-width: 100%;
    max-height: 56vh;
    width: auto;
    height: auto;
    box-shadow: 0 8px 22px rgba(21, 45, 70, 0.2);
}

.quick-options {
    margin: 18px 0;
}

.option-group {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #edf1f5;
}

.option-group > span {
    flex: 0 0 auto;
    color: #41536a;
    font-size: 0.88rem;
    font-weight: 600;
}

.pill-options {
    display: flex;
    gap: 5px;
    padding: 3px;
    background: #eef2f6;
    border-radius: 6px;
}

.pill-options button {
    min-width: 52px;
    padding: 7px 9px;
    color: #607087;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.pill-options button.active {
    color: #1677ff;
    background: #fff;
    box-shadow: 0 2px 6px rgba(25, 55, 85, 0.1);
}

.simple-colors {
    display: flex;
    gap: 12px;
}

.simple-colors button {
    width: 34px;
    height: 34px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
}

.simple-colors button i {
    color: #fff;
    opacity: 0;
}

.simple-colors .white i {
    color: #1677ff;
}

.simple-colors button.active {
    box-shadow: 0 0 0 2px #1677ff;
}

.simple-colors button.active i {
    opacity: 1;
}

.simple-colors .white { background: #fff; }
.simple-colors .blue { background: #438edb; }
.simple-colors .red { background: #d90000; }

.simple-switch {
    display: block;
    cursor: pointer;
}

.simple-switch input {
    display: none;
}

.simple-switch span {
    position: relative;
    display: block;
    width: 44px;
    height: 25px;
    background: #b9c5d2;
    border-radius: 13px;
    transition: background 0.2s;
}

.simple-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(20, 40, 60, 0.25);
    transition: transform 0.2s;
}

.simple-switch input:checked + span {
    background: #1677ff;
}

.simple-switch input:checked + span::after {
    transform: translateX(19px);
}

.download-action {
    margin-top: 10px;
}

.camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(11, 20, 31, 0.88);
}

.camera-overlay[hidden] {
    display: none;
}

.camera-panel {
    width: min(100%, 500px);
    padding: 14px;
    color: #fff;
    background: #111c29;
    border-radius: 8px;
}

.camera-bar {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    margin-bottom: 12px;
    text-align: center;
}

.camera-bar button {
    width: 38px;
    height: 38px;
    color: #fff;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

.camera-view {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #05080c;
    border-radius: 6px;
}

.camera-view video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-guide {
    position: absolute;
    inset: 12% 12% 8%;
    border: 1px dashed rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.camera-guide::before {
    content: "";
    position: absolute;
    top: 8%;
    left: 50%;
    width: 58%;
    height: 42%;
    transform: translateX(-50%);
    border: 1px dashed rgba(255, 255, 255, 0.75);
    border-radius: 50%;
}

.camera-guide span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px dashed rgba(255, 255, 255, 0.35);
}

.camera-panel p {
    margin: 12px 0;
    color: #b9c7d6;
    text-align: center;
    font-size: 0.82rem;
}

.camera-shutter {
    display: grid;
    width: 66px;
    height: 66px;
    margin: 0 auto;
    place-items: center;
    background: transparent;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
}

.camera-shutter span {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
}

@media (min-width: 720px) {
    .id-photo-app {
        padding-top: 16px;
    }

    .upload-stage {
        margin-top: 45px;
    }
}

@media (max-width: 600px) {
    .contact-card {
        display: none;
    }

    .id-photo-app {
        padding-right: 12px;
        padding-left: 12px;
    }

    .id-photo-stage,
    .processing-stage,
    .result-stage {
        padding: 22px 16px;
    }

    .result-preview {
        min-height: 360px;
        padding: 12px;
    }

    .camera-overlay {
        padding: 0;
    }

    .camera-panel {
        width: 100%;
        min-height: 100%;
        border-radius: 0;
    }
}
