body.landing-page {
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.top-actions {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    pointer-events: none;
}

.top-actions > * {
    pointer-events: auto;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--navy);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
}

body.landing-page .lang-switch {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
}

.lang-opt {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.lang-opt.active {
    opacity: 1;
    font-weight: 700;
}

.lang-opt:hover {
    opacity: 0.8;
}

.btn-logout {
    background: var(--white);
    color: var(--red, #e74c3c);
    border: 1px solid #e74c3c;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: #e74c3c;
    color: #fff;
}

.landing-header {
    text-align: center;
    margin-top: 40px;
}

.landing-header h1 {
    font-family: 'Georgia', serif;
    font-size: 2.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--navy);
    line-height: 1.1;
}

.landing-header .subtitle {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.preview-circle {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 32px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--cream-dark);
    background: var(--gray-100);
}

.preview-circle .half-photo,
.preview-circle .half-art {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.preview-circle .half-photo {
    left: 0;
    background: linear-gradient(135deg, #e8c8a0 0%, #d4a574 100%);
}

.preview-circle .half-art {
    right: 0;
    background: linear-gradient(135deg, #666 0%, #333 50%, #888 100%);
}

.preview-circle .divider {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--white);
    transform: translateX(-50%);
    z-index: 2;
}

.preview-circle .center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
    font-weight: 300;
    z-index: 3;
}

.steps-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 24px 0 32px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 140px;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.step-label {
    font-size: 0.8rem;
    text-align: center;
    color: var(--gray-700);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 60px;
}

.auth-card h2 {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 0 12px 0;
    display: block;
    transition: color 0.15s;
}

.btn-back:hover {
    color: var(--navy);
}

.auth-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 16px;
    line-height: 1.4;
}

.auth-hint strong {
    color: var(--navy);
    letter-spacing: 0.5px;
}

.auth-card .form-group {
    margin-bottom: 14px;
}

.auth-card .form-group:last-of-type {
    margin-bottom: 20px;
}

.hidden-file-input {
    display: none;
}

.hidden {
    display: none !important;
}

/* Button spinner (inline loading indicator) */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Project limit info */
.project-limit-info {
    text-align: center;
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 12px;
    padding: 8px;
    background: var(--gray-100);
    border-radius: 6px;
}

.project-limit-info strong {
    color: var(--navy);
}

/* Crop Editor Overlay */
.crop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 16px;
}

.crop-overlay.hidden {
    display: none !important;
}

.crop-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.crop-canvas {
    border-radius: 8px;
    touch-action: none;
    cursor: grab;
    max-width: 100%;
}

.crop-canvas:active {
    cursor: grabbing;
}

.crop-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.crop-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.crop-rotate-btn {
    background: #333;
    color: #ccc;
}

.crop-rotate-btn:hover { background: #444; color: #fff; }

.crop-cancel-btn {
    background: #333;
    color: #ccc;
}

.crop-cancel-btn:hover { background: #444; color: #fff; }

.crop-process-btn {
    background: var(--navy);
    color: var(--white);
}

.crop-process-btn:hover { background: var(--navy-hover); }

/* Background Removal Overlay */
.bg-remove-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 16px;
    gap: 14px;
}

.bg-remove-overlay.hidden {
    display: none !important;
}

.bg-remove-header {
    text-align: center;
}

.bg-remove-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.bg-remove-status {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: 4px;
    min-height: 20px;
}

.bg-remove-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#bgRemoveCanvas {
    border-radius: 50%;
    max-width: 90vw;
    max-height: 50vh;
}

.bg-remove-toggle {
    display: flex;
    gap: 6px;
    background: #222;
    border-radius: 20px;
    padding: 3px;
}

.bg-toggle-btn {
    padding: 6px 18px;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #888;
    transition: all 0.2s;
}

.bg-toggle-btn.active {
    background: #4da6ff;
    color: #fff;
}

.bg-remove-controls {
    display: flex;
    gap: 24px;
    max-width: 500px;
    width: 100%;
}

.bg-slider-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bg-slider-group label {
    color: #ccc;
    font-size: 0.78rem;
    font-weight: 600;
}

.bg-slider-group input[type="range"] {
    width: 100%;
    accent-color: #4da6ff;
    height: 6px;
    cursor: pointer;
}

.bg-slider-group span {
    color: #888;
    font-size: 0.72rem;
    text-align: right;
}

.bg-remove-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* Style Preview Overlay */
.style-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    padding: 16px;
    gap: 16px;
}

.style-overlay.hidden {
    display: none !important;
}

.style-header {
    text-align: center;
}

.style-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.style-status {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 720px;
    width: 100%;
}

.style-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.15s, opacity 0.4s;
    opacity: 0.4;
    pointer-events: none;
    position: relative;
}

.style-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -24px 0 0 -14px;
    border: 3px solid #333;
    border-top-color: #4da6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

.style-card.ready::before {
    display: none;
}

.style-card.ready {
    opacity: 1;
    pointer-events: auto;
}

.style-card:hover {
    border-color: #555;
    transform: scale(1.02);
}

.style-card.selected {
    border-color: #4da6ff;
    transform: scale(1.03);
}

.style-canvas {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    display: block;
}

.style-label {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 8px;
}

.style-desc {
    color: #888;
    font-size: 0.75rem;
    margin-top: 2px;
}

.style-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* Projects page */
body.projects-page {
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
}

.projects-container {
    width: 100%;
    max-width: 520px;
    padding: 0 20px;
}

.projects-container h1 {
    text-align: center;
    font-size: 1.4rem;
    color: var(--navy);
    margin-bottom: 24px;
}

.project-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.project-info .status {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.btn-continue {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--navy);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-continue:hover {
    background: var(--navy-hover);
}

.btn-new-project {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    background: var(--white);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 600;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s, background 0.2s;
}

.btn-new-project:hover {
    border-color: var(--navy);
    background: var(--gray-100);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 48px;
    text-align: center;
}

.loading-box p {
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* ============ MOBILE ============ */
@media (max-width: 600px) {
    .bg-remove-controls {
        flex-direction: column;
        gap: 10px;
    }

    #bgRemoveCanvas {
        max-height: 40vh;
    }

    .style-grid {
        gap: 10px;
        max-width: 100%;
    }

    .style-card {
        padding: 8px;
        border-radius: 8px;
    }

    .style-label { font-size: 0.82rem; }
    .style-desc { font-size: 0.68rem; }
    .style-title { font-size: 1rem; }

    .landing-header {
        margin-top: 24px;
    }

    .landing-header h1 {
        font-size: 1.8rem;
    }

    .preview-circle {
        width: 180px;
        height: 180px;
        margin: 20px auto;
    }

    .steps-row {
        gap: 16px;
        margin: 16px 12px 24px;
    }

    .step-item {
        max-width: 100px;
    }

    .step-num {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .auth-card {
        margin: 0 16px 40px;
        padding: 24px 20px;
    }

    .auth-card h2 {
        font-size: 1rem;
    }

    .lang-switch {
        top: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    /* Projects page mobile */
    body.projects-page {
        padding-top: 40px;
    }

    .projects-container {
        padding: 0 16px;
    }

    .projects-container h1 {
        font-size: 1.2rem;
    }

    .project-card {
        padding: 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-continue {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .steps-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .step-item {
        flex-direction: row;
        max-width: unset;
        gap: 12px;
    }

    .preview-circle {
        width: 150px;
        height: 150px;
    }
}
