/* Skin Analysis Plugin v1.0 | Elos Klinik | Mor Tema */

html, body { overflow-x: hidden !important; max-width: 100vw !important; }

#skin-analysis-wrapper, #skin-analysis-wrapper * { max-width: 100% !important; box-sizing: border-box !important; }
#skin-analysis-wrapper { overflow: hidden !important; width: 100% !important; }
#sa-form-wrap, #skin-analysis-result, #sa-loading-screen { overflow-x: hidden !important; width: 100% !important; }
.iti__country-list { max-width: calc(100vw - 32px) !important; overflow-x: hidden !important; }
#sa-result-content, #sa-result-content * { max-width: 100% !important; word-break: break-word !important; overflow-wrap: break-word !important; }

:root {
    --sa-purple: #7c3aed;
    --sa-purple-dark: #6d28d9;
    --sa-purple-light: #f5f3ff;
    --sa-dark: #111111;
    --sa-text: #1a1a1a;
    --sa-text-muted: #555;
    --sa-border: #e2e5ea;
    --sa-white: #ffffff;
    --sa-green: #22c55e;
    --sa-green-dark: #16a34a;
}

* { box-sizing: border-box; }

#skin-analysis-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--sa-text);
    -webkit-font-smoothing: antialiased;
}

/* ==============================
   HEADER
============================== */
.sa-header {
    background: linear-gradient(160deg, #0f0f0f 0%, #1a1030 55%, #2d1060 100%);
    border-radius: 20px;
    margin-bottom: 28px;
    overflow: hidden;
    position: relative;
}

.sa-header::before {
    content: '';
    position: absolute;
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(124,58,237,.25) 0%, transparent 65%);
    top: -120px; right: -100px;
    animation: sa-bgpulse 6s ease-in-out infinite;
    pointer-events: none;
}

.sa-header::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 65%);
    bottom: -80px; left: -60px;
    pointer-events: none;
}

@keyframes sa-bgpulse { 0%,100%{opacity:.6;transform:scale(1)} 50%{opacity:1;transform:scale(1.12)} }

.sa-header-inner { padding: 44px 32px 40px; text-align: center; position: relative; z-index: 1; }

.sa-brand-title {
    font-size: 1.4rem; font-weight: 900; color: #ffffff;
    letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sa-free-badge {
    display: inline-block;
    background: var(--sa-purple);
    color: #fff;
    font-size: .7rem; font-weight: 700;
    padding: 5px 16px; border-radius: 20px;
    letter-spacing: .1em; text-transform: uppercase;
    margin-bottom: 18px;
}

.sa-header-icon { font-size: 54px; display: block; margin-bottom: 14px; }

.sa-header h2 {
    font-size: 2rem !important; font-weight: 800 !important;
    color: #ffffff !important; margin: 0 0 12px !important;
    border: none !important; line-height: 1.25; letter-spacing: -.025em;
}

.sa-header h2 span { color: #c084fc; }

.sa-header p { color: rgba(255,255,255,.7) !important; font-size: .98rem; margin: 0 0 28px; }

.sa-header-stats {
    display: inline-flex;
    justify-content: center; align-items: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px; padding: 16px 24px;
}

.sa-stat { text-align: center; padding: 0 24px; }
.sa-stat strong { display: block; font-size: 1.25rem; font-weight: 800; color: #fff; }
.sa-stat span { font-size: .75rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .05em; }
.sa-stat-sep { width: 1px; height: 36px; background: rgba(255,255,255,.15); }

/* ==============================
   FORM SECTIONS
============================== */
.sa-section {
    background: var(--sa-white);
    border: 1.5px solid var(--sa-border);
    border-radius: 16px; padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
}

.sa-section-title {
    font-size: 1rem; font-weight: 700; color: var(--sa-text);
    margin: 0 0 20px; padding-bottom: 14px;
    border-bottom: 2px solid var(--sa-purple-light);
}

.sa-subtitle { color: var(--sa-text-muted); font-size: .875rem; margin-bottom: 18px; }
.sa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px){ .sa-grid-2 { grid-template-columns: 1fr; } }

.sa-field { margin-bottom: 16px; }
.sa-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--sa-text); margin-bottom: 6px; }

.sa-field input[type="text"],
.sa-field input[type="number"],
.sa-field input[type="tel"] {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid #d1d5db; border-radius: 10px;
    font-size: .95rem; color: var(--sa-text);
    transition: border-color .2s, box-shadow .2s;
    background: #fff; box-sizing: border-box;
}

.sa-field input:focus {
    outline: none;
    border-color: var(--sa-purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.required { color: var(--sa-purple); }

.sa-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }

.sa-radio {
    display: flex !important; align-items: center;
    gap: 8px; padding: 10px 18px;
    border: 1.5px solid #d1d5db; border-radius: 10px;
    cursor: pointer; transition: all .2s;
    font-size: .9rem; font-weight: 500 !important;
    color: var(--sa-text) !important;
}

.sa-radio:has(input:checked) {
    border-color: var(--sa-purple);
    background: var(--sa-purple-light);
    color: var(--sa-purple) !important;
}

.sa-radio input { margin: 0; accent-color: var(--sa-purple); }

/* PHOTO GRID */
.sa-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}

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

.sa-photo-item { display: flex; flex-direction: column; align-items: center; }

.sa-upload-box {
    width: 100%; aspect-ratio: 1;
    max-width: 220px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
}

.sa-upload-box:hover { border-color: var(--sa-purple); background: var(--sa-purple-light); }

.sa-preview {
    width: 100%; height: 100%;
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.sa-photo-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 20px; text-align: center;
    height: 100%;
}

.sa-photo-icon { font-size: 2.4rem; }
.sa-photo-label { font-size: .72rem; font-weight: 800; color: var(--sa-purple); letter-spacing: .06em; }
.sa-photo-hint { font-size: .66rem; color: #9ca3af; }
.sa-photo-desc { font-size: .72rem; color: var(--sa-text-muted); margin: 8px 0 0; text-align: center; line-height: 1.4; }

/* TIPS */
.sa-tips {
    background: #fffbeb; border: 1.5px solid #fde68a;
    border-radius: 12px; padding: 18px 22px; margin-bottom: 20px;
}
.sa-tips h4 { margin: 0 0 10px; color: #92400e; font-size: .875rem; }
.sa-tips ul { margin: 0; padding: 0; list-style: none; }
.sa-tips li { font-size: .82rem; color: #78350f; margin-bottom: 3px; }

/* CONSENT */
.sa-consent { margin-bottom: 20px; }
.sa-checkbox {
    display: flex !important; align-items: flex-start;
    gap: 10px; cursor: pointer;
    font-size: .85rem !important; color: var(--sa-text-muted) !important;
    font-weight: 400 !important;
}
.sa-checkbox input { margin-top: 2px; flex-shrink: 0; accent-color: var(--sa-purple); }

/* SUBMIT */
.sa-submit-btn {
    width: 100%; padding: 17px 24px;
    background: var(--sa-purple); color: #fff;
    border: none; border-radius: 12px;
    font-size: 1.05rem; font-weight: 700;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    min-height: 56px; letter-spacing: .01em;
}

.sa-submit-btn:hover:not(:disabled) {
    background: var(--sa-purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,.35);
}

.sa-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

@keyframes sa-spin { to { transform: rotate(360deg); } }
.sa-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff; border-radius: 50%;
    animation: sa-spin .8s linear infinite;
    display: inline-block;
}

.sa-privacy-note { text-align: center; font-size: .78rem; color: #9ca3af; margin-top: 10px; }

/* ==============================
   LOADING SCREEN
============================== */
#sa-loading-screen {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 99999 !important;
    background: linear-gradient(160deg, #0f0f0f 0%, #1a1030 60%, #2d1060 100%);
    border-radius: 0; padding: 48px 32px;
    text-align: center; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow-y: auto; overflow-x: hidden;
}

#sa-loading-screen::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(124,58,237,.18) 0%, transparent 65%);
    top: -150px; right: -150px; pointer-events: none;
}

.sa-loading-card { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 0 auto; }

/* Skin scene animation */
.sa-skin-scene {
    width: 200px; height: 100px;
    margin: 0 auto 32px;
    position: relative;
    background: linear-gradient(180deg, #f9d5c5, #f0b8a0);
    border-radius: 100px 100px 60px 60px;
    overflow: hidden;
}

.sa-skin-base {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
}

.sa-scan-beam {
    position: absolute;
    top: 0; left: -100%; bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(124,58,237,.5), transparent);
    animation: sa-scanbeam 2.5s ease-in-out infinite;
}

@keyframes sa-scanbeam { 0%{left:-30%} 100%{left:120%} }

.sa-scan-dots { position: absolute; inset: 0; }
.sa-dot {
    position: absolute;
    left: var(--dx); top: var(--dy);
    width: 7px; height: 7px;
    background: var(--sa-purple);
    border-radius: 50%;
    animation: sa-dotpulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px var(--sa-purple);
}
@keyframes sa-dotpulse { 0%,100%{opacity:0;transform:scale(.5)} 50%{opacity:1;transform:scale(1.2)} }

.sa-loading-title { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.sa-loading-subtitle { font-size: .9rem; color: rgba(255,255,255,.6); margin-bottom: 28px; }

.sa-loading-notice {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px; padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .82rem; color: rgba(255,255,255,.8);
    line-height: 1.5; text-align: left;
}
.sa-loading-notice span { font-size: 1.2rem; flex-shrink: 0; }

/* Progress steps */
.sa-progress-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; text-align: left; }

.sa-pstep {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; transition: all .3s;
}

.sa-pstep.active { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.35); }
.sa-pstep.done { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.25); }
.sa-pstep-icon { font-size: 1.4rem; flex-shrink: 0; }
.sa-pstep-info { flex: 1; }
.sa-pstep-label { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.85); margin-bottom: 6px; }
.sa-pstep-bar { height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.sa-pstep-fill { height: 100%; width: 0; background: var(--sa-purple); border-radius: 4px; transition: width 1s ease; }
.sa-pstep.done .sa-pstep-fill { width: 100%; background: var(--sa-green); }
.sa-pstep.active .sa-pstep-fill { width: 60%; animation: sa-loadprogress 3s ease-in-out infinite; }
@keyframes sa-loadprogress { 0%{width:20%} 50%{width:80%} 100%{width:20%} }

/* Facts */
.sa-facts-box {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px; padding: 18px 20px; text-align: left;
}
.sa-fact-label { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.sa-facts-carousel { position: relative; min-height: 44px; }
.sa-facts-carousel .sa-fact { font-size: .85rem; color: rgba(255,255,255,.8); line-height: 1.6; display: none; animation: sa-factfade .5s ease; }
.sa-facts-carousel .sa-fact.active { display: block; }
@keyframes sa-factfade { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

/* ==============================
   RESULT
============================== */
#skin-analysis-result {
    background: var(--sa-white);
    border: 1.5px solid var(--sa-border);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

.sa-result-header {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    padding: 40px 32px 36px; text-align: center;
    position: relative; overflow: hidden;
}

.sa-result-header::before {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 65%);
    top: -100px; right: -80px; pointer-events: none;
}

.sa-result-icon { font-size: 2.8rem; display: block; margin-bottom: 10px; position: relative; z-index: 1; }

.sa-result-header h3 {
    font-size: 1.7rem !important; font-weight: 800 !important;
    color: #fff !important; margin: 0 0 8px !important;
    position: relative; z-index: 1;
}

.sa-result-header p { color: rgba(255,255,255,.85) !important; font-size: .95rem; margin: 0; position: relative; z-index: 1; }

.sa-result-content { padding: 36px; line-height: 1.8; }

.sa-result-content h2 {
    font-size: 1.3rem; color: var(--sa-text);
    border-bottom: 2px solid var(--sa-purple-light);
    padding-bottom: 12px; margin-top: 0;
}

.sa-result-content h3 {
    font-size: 1rem; font-weight: 700;
    color: var(--sa-purple); margin-top: 28px; margin-bottom: 10px;
    padding: 10px 14px;
    background: var(--sa-purple-light);
    border-left: 3px solid var(--sa-purple);
    border-radius: 0 8px 8px 0;
}

.sa-result-content p { margin-bottom: 12px; color: #374151; }
.sa-result-content ul { padding-left: 20px; }
.sa-result-content li { margin-bottom: 6px; color: #374151; }
.sa-result-content strong { color: var(--sa-text); }

/* ==============================
   CTA BOX
============================== */
.sa-cta-box {
    background: linear-gradient(160deg, #0f0f0f 0%, #1a1030 60%, #2d1060 100%);
    padding: 48px 32px 40px; text-align: center;
    position: relative; overflow: hidden;
}

.sa-cta-box::before {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(124,58,237,.2) 0%, transparent 65%);
    top: -120px; right: -100px; pointer-events: none;
}

.sa-cta-inner { position: relative; z-index: 1; }

.sa-cta-badge {
    display: inline-block; background: var(--sa-purple); color: #fff;
    font-size: .68rem; font-weight: 700;
    padding: 5px 16px; border-radius: 20px;
    letter-spacing: .1em; text-transform: uppercase; margin-bottom: 20px;
}

.sa-cta-box h3 {
    font-size: 1.7rem !important; font-weight: 800 !important;
    color: #ffffff !important; margin: 0 0 16px !important;
    line-height: 1.25 !important; letter-spacing: -.02em;
    border: none !important; background: transparent !important; padding: 0 !important;
}

.sa-cta-box h3 span { color: #c084fc; }

.sa-cta-subtitle { font-size: .98rem; color: rgba(255,255,255,.92); margin: 0 0 10px; line-height: 1.65; }
.sa-cta-subtitle strong { color: #fff; }
.sa-cta-location { font-size: .84rem; color: rgba(255,255,255,.95) !important; margin: 0 0 32px; }
.sa-cta-location strong { color: #c084fc !important; }

.sa-cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.sa-btn-whatsapp {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; padding: 15px 28px;
    background: #25D366; color: #fff !important;
    border: none; border-radius: 50px;
    font-size: .95rem; font-weight: 700;
    cursor: pointer; text-decoration: none !important;
    transition: all .22s; min-width: 200px;
    box-shadow: 0 4px 16px rgba(37,211,102,.25);
}
.sa-btn-whatsapp:hover { background: #1ebe5d; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,211,102,.38); color: #fff !important; }

.sa-btn-call {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; padding: 15px 28px;
    background: transparent; color: #fff !important;
    border: 2px solid var(--sa-purple); border-radius: 50px;
    font-size: .95rem; font-weight: 700;
    cursor: pointer; text-decoration: none !important;
    transition: all .22s; min-width: 200px;
}
.sa-btn-call:hover { background: var(--sa-purple); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,.38); color: #fff !important; }

.sa-cta-divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 28px 0 22px; }

.sa-btn-new {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 11px 24px;
    background: transparent; color: rgba(255,255,255,.65) !important;
    border: 1.5px solid rgba(255,255,255,.15); border-radius: 50px;
    font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.sa-btn-new:hover { color: #fff !important; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.07); }

/* ERROR */
.sa-error {
    background: #fef2f2; border: 1.5px solid #fecaca;
    border-radius: 12px; padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; font-size: .9rem; color: #991b1b;
}
.sa-error p { margin: 0; }

/* intl-tel-input dropdown fix */
.iti__country-list { list-style: none !important; padding-left: 0 !important; margin: 0 !important; }
.iti__country-list li, .iti__country-list .iti__country {
    list-style: none !important; list-style-type: none !important;
    padding-left: 8px !important; margin-left: 0 !important; background-image: none !important;
}
.iti__country-list li::before, .iti__country-list .iti__country::before { display: none !important; content: none !important; }

/* Result active - hide form elements */
body.sa-result-active #sa-tips-block,
body.sa-result-active #sa-consent-block,
body.sa-result-active #sa-privacy-block,
body.sa-result-active #sa-submit,
body.sa-result-active #sa-form-wrap {
    display: none !important; visibility: hidden !important;
    height: 0 !important; overflow: hidden !important;
    margin: 0 !important; padding: 0 !important;
}

/* MOBILE */
@media(max-width:600px){
    .sa-header-inner { padding: 32px 20px 28px; }
    .sa-header h2 { font-size: 1.6rem !important; }
    .sa-header-stats { flex-direction: column; gap: 8px; padding: 14px 20px; }
    .sa-stat-sep { width: 40px; height: 1px; }
    .sa-result-content { padding: 20px; }
    .sa-cta-box { padding: 36px 20px 32px; }
    .sa-cta-box h3 { font-size: 1.35rem !important; }
    .sa-btn-whatsapp, .sa-btn-call { min-width: unset; width: 100%; }
    .sa-cta-buttons { flex-direction: column; }
    #sa-loading-screen { padding: 36px 20px; }
    .sa-photo-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
    .sa-header, .sa-cta-box, #sa-loading-screen { display: none !important; }
    #skin-analysis-result { box-shadow: none; border: none; }
    .sa-result-content { padding: 0; }
}
