* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-green: #1B4D3E;
    --bright-green: #2ECC71;
    --light-green: #E8F5E9;
    --white: #FFFFFF;
    --gray: #666;
    --light-gray: #f8f9fa;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--white);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background: var(--deep-green);
    padding: 10px 20px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-report-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-report-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.logo {
    height: 32px;
    width: auto;
}

.title-section {
    background: var(--light-green);
    padding: 20px 0;
    text-align: center;
}

.main-title {
    color: var(--deep-green);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
}

main {
    padding: 20px 0;
    background: linear-gradient(180deg, #E8F5E9 0%, #F5F5F5 50%, #E8F5E9 100%);
    min-height: calc(100vh - 150px);
}

section {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

h2 {
    font-size: 0.95rem;
    color: var(--deep-green);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gender-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.gender-option {
    flex: 1;
    max-width: 130px;
    cursor: pointer;
}

.gender-option input {
    display: none;
}

.option-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.option-box:hover {
    border-color: var(--bright-green);
}

.option-box i {
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: #999;
    transition: all 0.3s ease;
}

.option-box span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

.gender-option input:checked + .option-box {
    border-color: var(--deep-green);
    background: var(--deep-green);
}

.gender-option input:checked + .option-box i,
.gender-option input:checked + .option-box span {
    color: white;
}

.guide-text {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 12px;
    text-align: center;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

.upload-card {
    background: var(--light-green);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid #C8E6C9;
    cursor: pointer;
}

.upload-card h3 {
    font-size: 0.8rem;
    color: var(--deep-green);
    margin-bottom: 10px;
    font-weight: 600;
}

.image-preview {
    width: 100%;
    height: 90px;
    border: 2px dashed #A5D6A7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-preview:hover {
    border-color: var(--bright-green);
}

.image-preview i {
    font-size: 1.8rem;
    color: var(--bright-green);
    margin-bottom: 5px;
}

.image-preview span {
    color: #81C784;
    font-size: 0.75rem;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.action-section {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    text-align: center;
}

.analyze-btn {
    background: var(--bright-green);
    color: white;
    border: none;
    padding: 15px 45px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.analyze-btn:hover {
    background: #27AE60;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.5);
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.analyze-btn i {
    margin-right: 10px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 77, 62, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    margin: 20px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



.disclaimer-box {
    background-color: #F8F9FA;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0 0 0;
    text-align: center;
    word-break: keep-all;
}

.disclaimer-box p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555555;
    line-height: 1.6;
}

.stage-result-transformed {
    padding: 0 !important;
    background: transparent !important;
}

.stage-result-section {
    text-align: center;
    padding: 20px;
    background: var(--light-green);
    border-radius: 15px;
    margin-bottom: 15px;
}

.stage-result-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 15px;
    border-radius: 16px;
    animation: transformIn 0.5s ease;
}

.stage-result-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stage-result-text {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    white-space: nowrap;
}

@keyframes transformIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.demo-label {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: 10px;
    font-style: italic;
}

.image-preview {
    position: relative;
}

.remove-photo-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    transition: background 0.2s;
}

.remove-photo-btn:hover {
    background: rgba(220,50,50,0.85);
}

.image-preview.drag-over {
    border-color: var(--deep-green) !important;
    background-color: rgba(46, 125, 50, 0.08) !important;
    border-style: solid !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.cause-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.cause-card {
    padding: 16px 18px;
    border-radius: 12px;
    border-left: 4px solid;
}

.cause-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cause-icon {
    font-size: 1.1rem;
}

.cause-card p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
}

.cause-overall {
    background: #EDF7ED;
    border-left-color: var(--deep-green);
}

.cause-overall h4 {
    color: var(--deep-green);
}

.cause-forehead {
    background: #FFF8E1;
    border-left-color: #F9A825;
}

.cause-forehead h4 {
    color: #E65100;
}

.cause-crown {
    background: #EDE7F6;
    border-left-color: #7E57C2;
}

.cause-crown h4 {
    color: #4527A0;
}

#result-data.hidden {
    display: none !important;
}

#result-error.hidden {
    display: none !important;
}

.modal-header h2 {
    color: var(--deep-green);
    text-align: center;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--deep-green);
}

.loading {
    text-align: center;
    padding: 30px;
    color: var(--deep-green);
    background: var(--light-green);
    border-radius: 15px;
    margin: -10px -10px 0 -10px;
}

.progress-container {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--bright-green), var(--deep-green));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep-green);
    margin-bottom: 8px;
}

.progress-status {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
}

.stage-preview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.stage-preview-grid.stage-count-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stage-preview-card {
    border-radius: 8px;
    padding: 8px 2px;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0.5;
    color: white;
    white-space: nowrap;
}

.stage-bg-1 { background: #1B8A2E; }
.stage-bg-2 { background: #6BBF59; }
.stage-bg-3 { background: #EAB308; }
.stage-bg-4 { background: #F97316; }
.stage-bg-5 { background: #E53E3E; }
.stage-bg-6 { background: #9333EA; }

.stage-preview-card.scanning {
    opacity: 1;
}

.stage-preview-card.selected {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.preview-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
}

.preview-name {
    display: block;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.9);
}

.result-summary {
    color: white;
    transition: background-color 0.3s ease;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.stage-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.stage-icon {
    font-size: 2rem;
}

.stage-text {
    font-size: 1.3rem;
    font-weight: 700;
}

.stage-1 { background: #22C55E; }
.stage-2 { background: #EAB308; }
.stage-3 { background: #F97316; }
.stage-4 { background: #EF4444; }
.stage-5 { background: #A855F7; }
.stage-6 { background: #374151; }

.stage-description {
    background: var(--light-green);
    padding: 15px 20px;
    border-radius: 10px;
    color: var(--deep-green);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
    border-left: 4px solid var(--bright-green);
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    background: var(--light-gray);
    padding: 18px;
    border-radius: 12px;
}

.detail-item h4 {
    color: var(--deep-green);
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item p {
    color: #555;
    line-height: 1.6;
    font-size: 0.9rem;
}

.detail-item ul {
    list-style: none;
    padding: 0;
}

.detail-item ul li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
    line-height: 1.5;
    font-size: 0.9rem;
}

.detail-item ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--bright-green);
    font-weight: bold;
}

.detail-item.analysis-box {
    background: var(--light-green);
    border-left: 4px solid var(--deep-green);
}

.detail-item.solution {
    background: #E8F5E9;
    border-left: 4px solid var(--bright-green);
}

.detail-item.solution h4 {
    color: #27AE60;
}

.detail-item.professional {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
}

.detail-item.professional h4 {
    color: #E65100;
}

.restart-btn {
    display: block;
    width: 100%;
    background: var(--deep-green);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background: #15403A;
}

.error-message {
    text-align: center;
    padding: 30px;
    color: #e74c3c;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-message p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #666;
}

.retry-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #c0392b;
}

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.fullscreen-modal.hidden {
    display: none;
}

.fullscreen-modal-content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.ad-placeholder-inline {
    width: 100%;
    height: 250px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.ad-placeholder-inline p {
    color: #999;
    font-size: 1rem;
    font-weight: 600;
}

.ad-wait-message {
    text-align: center;
    color: white;
}

.ad-wait-message i {
    font-size: 3rem;
    color: #F9A825;
    margin-bottom: 20px;
}

.ad-wait-message h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.5;
    color: white;
}

.ad-wait-message p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.countdown-timer {
    font-size: 4rem;
    font-weight: 700;
    color: #F9A825;
    line-height: 1;
    font-family: 'Montserrat', sans-serif;
}

.countdown-unit {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.cta-product-btn {
    display: block;
    width: 100%;
    padding: 18px 20px;
    margin-top: 20px;
    background: linear-gradient(135deg, #1A3A8A, #2563EB);
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.cta-product-btn:hover {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.5);
}

.cta-product-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cta-product-btn.hidden {
    display: none !important;
}

footer {
    background: var(--deep-green);
    color: white;
    padding: 20px;
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-copy {
    opacity: 0.9;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .logo {
        height: 32px;
    }

    .tagline {
        font-size: 0.9rem;
    }

    section {
        padding: 15px;
    }

    .gender-options {
        flex-direction: row;
    }

    .analyze-btn {
        width: 100%;
        padding: 14px;
    }
}
