:root {
    --bg-color: #ffffff;
    --card-bg: #f5f5f5;
    --primary-color: #F95416;
    --primary-hover: #e04610;
    --text-main: #1a1a1a;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --btn-disabled: #d1d5db;
    --btn-text-disabled: #9ca3af;
    --accent-green: #16a34a;
    --tip-bg: #eff6ff;
    --tip-border: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #ffffff;
}

.step-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-content {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.step-content.active {
    display: flex;
}

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

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

/* Welcome Screen */
#step-welcome {
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80vh;
}

.brand-logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
    object-fit: contain;
}

.brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.brand .subtitle {
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 4px;
    font-size: 0.8rem;
    margin-bottom: 40px;
}

.hero-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
    padding: 0 20px;
}

.status-indicator {
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 60px;
}

.status-indicator .dot {
    height: 8px;
    width: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 10px var(--accent-green);
}

/* Progress Bar */
.progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 30px;
}

.progress-bar .segment {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.progress-bar .segment.active {
    background: var(--primary-color);
}

.progress-bar .segment.complete {
    background: var(--primary-color);
}

.step-number {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.description {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-color);
}

.field-error {
    color: #ef4444;
    font-size: 0.78rem;
    margin-top: 6px;
    font-weight: 500;
    min-height: 1em;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.custom-textarea {
    width: 100%;
    min-height: 120px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    resize: vertical;
}

.btn-continue {
    flex: 1;
    padding: 16px;
    background: #4a5568;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-continue:not(:disabled) {
    background: var(--primary-color);
}

.btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-back {
    width: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
}

.step-actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
    padding-top: 40px;
}

/* Option Cards */
.option-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: block;
    cursor: pointer;
}

.option-card input[type="radio"] {
    display: none;
}

.option-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.option-card input[type="radio"]:checked+.option-content {
    border-color: var(--primary-color);
    background: rgba(249, 84, 22, 0.05);
}

.option-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.option-text {
    flex: 1;
}

.option-text strong {
    display: block;
    font-size: 0.95rem;
}

.option-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
}

.option-card input[type="radio"]:checked+.option-content .radio-custom {
    border-color: var(--primary-color);
}

.option-card input[type="radio"]:checked+.option-content .radio-custom::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--primary-color);
    border-radius: 50%;
}

.camera-container,
.camera-container-small {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.camera-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-switch-upload {
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s;
}

.btn-switch-upload:hover {
    background: rgba(0, 0, 0, 0.1);
}

.camera-container video,
.camera-container-small video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-capture {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    background: white;
    border: 5px solid rgba(249, 84, 22, 0.4);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-capture:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    background: #f8f8f8;
}

.btn-capture:active {
    transform: translateX(-50%) scale(0.92);
}

.btn-capture::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

.btn-capture-small {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border: 3px solid rgba(249, 84, 22, 0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.btn-capture-small:active {
    transform: translateX(-50%) scale(0.9);
}

.btn-flip {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 101;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.btn-flip:active {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
}

.btn-flip.small {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.photo-preview-small {
    width: 100%;
    margin-bottom: 20px;
}

.photo-preview-small img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
}

.btn-retake {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-retake-small {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Pills */
.form-section {
    margin-top: 30px;
}

.section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    cursor: pointer;
}

.pill input {
    display: none;
}

.pill span {
    display: inline-block;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.pill input:checked+span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Option Rows (Stack) */
.option-grid-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-row {
    display: block;
    cursor: pointer;
}

.option-row input {
    display: none;
}

.row-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.row-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.option-row input:checked+.row-content {
    border-color: var(--primary-color);
    background: rgba(249, 84, 22, 0.05);
}

.option-row input:checked+.row-content .radio-custom {
    border-color: var(--primary-color);
}

.option-row input:checked+.row-content .radio-custom::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--primary-color);
    border-radius: 50%;
}

.row-text {
    flex: 1;
}

.row-text strong {
    display: block;
    font-size: 0.95rem;
}

.row-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Indicators */
.check-icon {
    font-size: 2.5rem;
    color: #4BB543;
    margin-bottom: 10px;
}

.instr-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.skip-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: underline;
}

.skip-text:hover {
    color: var(--primary-color);
}

.camera-container-small {
    aspect-ratio: 16/9;
}

.guide-box {
    width: 75%;
    height: 75%;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    display: none;
    /* Shown by JS when camera starts */
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    pointer-events: none;
}

.guide-box p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.photo-preview,
.photo-preview-small {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.photo-preview {
    aspect-ratio: 4 / 3;
}

.photo-preview-small {
    aspect-ratio: 16 / 9;
}

.photo-preview img,
.photo-preview-small img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 16px;
    border: none;
}

.captured-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Much lighter overlay to see the photo */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.captured-indicator.small .check-icon {
    font-size: 1.5rem;
}

.captured-indicator.small p {
    font-size: 0.75rem;
}

.check-icon {
    font-size: 2rem;
    color: #4BB543;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.captured-indicator p {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ── Success Screen ─────────────────────────────── */
#step-success {
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px 0;
}

.success-card {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Animated SVG checkmark */
.success-checkmark {
    width: 90px;
    height: 90px;
    margin-bottom: 28px;
}

.checkmark-svg {
    width: 100%;
    height: 100%;
}

.checkmark-circle {
    stroke: #16a34a;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-path {
    stroke: #16a34a;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke-check 0.4s 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes stroke-circle {
    100% { stroke-dashoffset: 0; }
}

@keyframes stroke-check {
    100% { stroke-dashoffset: 0; }
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.success-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding: 0 10px;
}

.success-info-box {
    width: 100%;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 0;
    margin-bottom: 32px;
    text-align: left;
}

.success-info-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.success-info-row:last-child {
    border-bottom: none;
}

.success-info-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.success-info-row strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 3px;
}

.success-info-row p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.success-btn {
    margin-top: 4px;
}