* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
}

.hidden {
    display: none !important;
}


/* =========================
   TELAS
========================= */

.tela {
    width: 100vw;
    height: 100vh;
    min-height: 100dvh;
}


/* =========================
   LOGO
========================= */

.tela-logo {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: #eeeeee;
}

.logo-siner {
    position: absolute;
    top: 25%;

    max-width: 80%;
}

.fruta,
.foto {
    position: absolute;
    margin: 16px 0;
}

.pera {
    bottom: -160px;
    animation: subir1 0.8s ease forwards;
    animation-delay: 0.2s;
}

.sand {
    bottom: -160px;
    animation: subir2 0.8s ease forwards;
    animation-delay: 0.4s;
}

.maca {
    bottom: -160px;
    animation: subir3 0.8s ease forwards;
    animation-delay: 0.6s;
}

.foto {
    opacity: 0;
    animation: aparecer 0.8s ease forwards;
    animation-delay: 0.8s;
}

.logo-siner {
    opacity: 0;
    animation: aparecer 0.8s ease forwards;
    animation-delay: 1s;
}

@keyframes subir1 {
    from {
        bottom: -160px;
    }

    to {
        bottom: 41vh;
    }
}

@keyframes subir2 {
    from {
        bottom: -160px;
    }

    to {
        bottom: 42vh;
    }
}

@keyframes subir3 {
    from {
        bottom: -160px;
    }

    to {
        bottom: 42vh;
    }
}

@keyframes aparecer {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================
   INTRO
========================= */

.tela-intro {
    background: #eeeeee;
    color: #000;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 24px;

    text-align: center;
}

.logo-food {
    width: 160px;
    max-width: 70%;
    margin-bottom: 16px;
}

.tela-intro h1 {
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 24px;
}

.tela-intro > p {
    font-size: 18px;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 0 16px;
}

.lista-instrucoes {
    padding: 0;
    margin: 0 0 24px;

    list-style: none;

    display: flex;
    flex-direction: column;
    gap: 10px;

    text-align: left;
}

.lista-instrucoes li {
    display: flex;
    align-items: center;
    gap: 10px;

    color: #000;
    font-size: 16px;
}

.icone-maca {
    font-size: 20px;
}


/* =========================
   BOTÕES
========================= */

.btn {
    border: 0;
    cursor: pointer;

    color: white;

    border-radius: 8px;

    padding: 12px 20px;

    font-size: 18px;
    font-weight: 600;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(
        to right,
        #0e219e,
        #2b42d8
    );

    width: 100%;
    max-width: 400px;
}

.btn-secondary {
    background: linear-gradient(
        to right,
        #6b6b6b,
        #818181
    );

    width: 100%;
}

.camera-icon {
    width: 32px;
    height: 32px;
}

.refresh-icon {
    width: 24px;
    height: 24px;
}


/* =========================
   CAMERA
========================= */

.tela-camera {
    position: relative;
    background: #000;
    overflow: hidden;
}

#camera-video {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

#camera-canvas {
    display: none;
}

.camera-overlay {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    padding: 30px 20px 40px;

    color: white;

    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25),
        transparent 40%,
        rgba(0, 0, 0, 0.6)
    );
}

.camera-overlay p {
    margin: 0 0 20px;

    font-size: 16px;

    text-align: center;
}

.camera-moldura {
    position: absolute;

    top: 50%;
    left: 50%;

    width: min(80vw, 380px);
    height: min(60vw, 300px);

    transform: translate(-50%, -50%);

    border: 3px solid rgba(255, 255, 255, 0.8);

    border-radius: 20px;

    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.25);
}

.btn-camera {
    width: 75px;
    height: 75px;

    border-radius: 50%;

    border: 5px solid white;

    background: #0e219e;

    color: white;

    font-size: 30px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-voltar {
    margin-top: 16px;

    border: 0;
    background: transparent;

    color: white;

    font-size: 16px;

    cursor: pointer;
}


/* =========================
   CARREGANDO
========================= */

.tela-carregando {
    background: #eeeeee;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: #000;
}

.load-icon {
    max-width: 120px;
    margin-bottom: 16px;
}

.tela-carregando h1 {
    font-size: 24px;
    font-weight: 500;

    margin: 0 0 20px;
}

.spinner {
    width: 48px;
    height: 48px;

    border: 4px solid #969696;
    border-top-color: transparent;

    border-radius: 50%;

    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   RESULTADO
========================= */

.tela-resultado {
    position: relative;

    display: flex;
    flex-direction: column;

    justify-content: flex-end;

    align-items: center;

    color: white;

    overflow: hidden;
}

.preview {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    z-index: -2;
}

.tela-resultado::after {
    content: "";

    position: absolute;

    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.45),
        transparent 60%
    );

    z-index: -1;
}

.resultado-card {
    width: 100%;
    max-width: 900px;

    background: white;

    color: black;

    border-radius: 12px 12px 0 0;

    padding: 24px;

    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);

    text-align: center;

    max-height: 70vh;

    overflow-y: auto;
}

.resultado-card h2 {
    font-size: 30px;
    font-weight: 400;

    margin: 0 0 12px;
}

.alimentos {
    margin-top: 10px;

    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;

    max-height: 300px;

    overflow-y: auto;
}

.alimento {
    padding: 12px 4px;

    border-bottom: 1px solid #eee;
}

.alimento:last-child {
    border-bottom: 0;
}

.alimento strong {
    display: block;

    font-size: 17px;

    margin-bottom: 4px;
}

.total {
    font-weight: 600;

    margin: 8px 0;
}

.erro {
    color: #ef4444;

    font-weight: bold;

    margin: 0 0 20px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .tela-intro h1 {
        font-size: 26px;
    }

    .tela-intro > p {
        font-size: 16px;
    }

    .resultado-card {
        padding: 20px;
    }

    .resultado-card h2 {
        font-size: 25px;
    }
}


/* =========================
   DESKTOP
========================= */

@media (min-width: 768px) {

    .btn-primary {
        width: 20%;
        min-width: 220px;
    }

    .resultado-card {
        width: 60vw;
    }
}


/* =========================
   WEBCHECK
========================= */
.tela-webcheck {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.webcheck-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.12);
    border: 1px solid #dbeafe;
    width: 100%;
    max-width: 440px;
    padding: 32px 24px;
    text-align: center;
}

.webcheck-header .webcheck-shield {
    width: 64px;
    height: 64px;
    background: #2563eb;
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.webcheck-header .webcheck-shield svg {
    width: 36px;
    height: 36px;
}

.webcheck-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.webcheck-header h1 span {
    color: #2563eb;
}

.webcheck-header p {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 20px;
}

.webcheck-icon-box {
    width: 56px;
    height: 56px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.webcheck-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

.webcheck-check {
    font-size: 28px;
    color: #10b981;
    font-weight: bold;
}

.webcheck-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2563eb;
    margin: 0 0 4px;
}

.webcheck-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.webcheck-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px;
    line-height: 1.4;
}

.webcheck-progress-container {
    margin-bottom: 20px;
}

.webcheck-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.webcheck-progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.webcheck-progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.webcheck-info-box {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    margin-bottom: 16px;
}

.webcheck-info-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 2px;
}

.webcheck-info-sub {
    font-size: 12px;
    color: #1d4ed8;
    margin: 0;
    line-height: 1.4;
}

.webcheck-code-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.webcheck-code-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.webcheck-code-value {
    font-size: 22px;
    font-weight: 800;
    font-family: monospace;
    color: #2563eb;
    letter-spacing: 2px;
}

.webcheck-hash-box {
    text-align: center;
}

.webcheck-hash-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
}

.webcheck-hash-value {
    font-size: 11px;
    font-family: monospace;
    color: #64748b;
    word-break: break-all;
}


/* =========================
   CONFIRMAÇÃO DA FOTO
========================= */
.tela-confirmacao {
    position: relative;
    background: #000;
    overflow: hidden;
}

.confirmacao-card {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.confirmacao-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.confirmacao-overlay {
    position: relative;
    z-index: 2;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.6) 65%,
        transparent 100%
    );
    padding: 30px 24px 40px;
    color: white;
    text-align: center;
    width: 100%;
}

.confirmacao-overlay h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
}

.confirmacao-overlay p {
    font-size: 14px;
    color: #cbd5e1;
    margin: 0 0 24px;
}

.confirmacao-botoes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .confirmacao-botoes {
        flex-direction: row;
        justify-content: center;
    }
}