* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
    background: #0d0d0d;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}
.app {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ===== TELAS ===== */
.tela { display: none; padding: 20px; }
.tela.ativa { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cabecalho {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px;
}
.cabecalho h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.btn-voltar {
    background: rgba(255,255,255,.1); border: none; color: #fff;
    padding: 8px 14px; border-radius: 10px; font-size: 14px; cursor: pointer;
}

/* ===== TELA 0: CAPA COM SENHA ===== */
.tela-senha {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 24px;
    background: #000000;
}
.tela-senha .logo-capa {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px rgba(255,102,0,.35));
}
.tela-senha .titulo-capa {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 6px;
}
.tela-senha .subtitulo-capa {
    font-size: 13px;
    color: #FF6600;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}
.tela-senha .ano-capa {
    font-size: 40px;
    font-weight: 900;
    color: #FF6600;
    letter-spacing: .05em;
    margin-bottom: 36px;
    text-shadow: 0 0 30px rgba(255,102,0,.4);
}
.campo-senha {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.campo-senha input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-size: 20px;
    text-align: center;
    letter-spacing: .3em;
    outline: none;
    transition: border-color .2s;
}
.campo-senha input:focus { border-color: #FF6600; }
.campo-senha input::placeholder { letter-spacing: .1em; font-size: 14px; color: #666; }
.btn-senha {
    width: 100%;
    background: #FF6600;
    border: none;
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.btn-senha:active { transform: scale(.97); }
.btn-senha:hover { box-shadow: 0 0 20px rgba(255,102,0,.4); }
.erro-senha {
    color: #ff4d4d;
    font-size: 13px;
    min-height: 18px;
    margin-top: 4px;
}

/* ===== TELA 1: MODELOS ===== */
.titulo-app { text-align: center; margin: 12px 0 4px; }
.titulo-app .marca { font-size: 12px; letter-spacing: .22em; color: #F0671E; text-transform: uppercase; font-weight: 600; }
.titulo-app h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.titulo-app p { font-size: 13px; color: #aaa; margin-top: 4px; }

.grade-modelos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.card-modelo {
    background: #1a1a1a; border: 2px solid transparent; border-radius: 16px;
    overflow: hidden; cursor: pointer; transition: all .2s;
}
.card-modelo.selecionado { border-color: #F0671E; transform: scale(1.02); }
.card-modelo .thumb { width: 100%; aspect-ratio: 9/16; background: #222; display: block; object-fit: cover; }
.card-modelo .label { padding: 10px; text-align: center; font-size: 13px; font-weight: 600; }

/* ===== TELA 2: DADOS ===== */
.form-dados { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.campo label { display: block; font-size: 12px; color: #aaa; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.campo input {
    width: 100%; background: #1a1a1a; border: 1px solid #333; border-radius: 12px;
    padding: 14px; color: #fff; font-size: 16px; outline: none;
}
.campo input:focus { border-color: #F0671E; }
.linha-dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.area-upload {
    border: 2px dashed #444; border-radius: 16px; padding: 30px 16px;
    text-align: center; cursor: pointer; transition: all .2s; background: #1a1a1a;
}
.area-upload.com-foto { border-style: solid; padding: 8px; }
.area-upload.com-foto img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; }
.upload-placeholder .icone-upload { font-size: 36px; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 14px; color: #aaa; }

.btn-primario {
    width: 100%; background: #F0671E; border: none; color: #fff;
    padding: 16px; border-radius: 14px; font-size: 17px; font-weight: 700;
    cursor: pointer; margin-top: 6px; letter-spacing: .02em;
}
.btn-primario:disabled { background: #444; cursor: not-allowed; }

/* ===== TELA 3: EDITOR ===== */
.editor-container { display: flex; flex-direction: column; gap: 14px; }
.moldura-editor {
    position: relative; width: 100%; aspect-ratio: 9/16; overflow: hidden;
    border-radius: 16px; background: #000; touch-action: none;
}
.moldura-editor canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.controles-editor { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grupo-controle {
    display: flex; align-items: center; gap: 8px; background: #1a1a1a;
    padding: 8px 12px; border-radius: 12px;
}
.btn-controle {
    background: #2a2a2a; border: none; color: #fff; width: 40px; height: 40px;
    border-radius: 10px; font-size: 20px; cursor: pointer;
}
.rotulo-controle { font-size: 12px; color: #aaa; }
.btn-reset {
    background: #2a2a2a; border: none; color: #fff; padding: 12px 16px;
    border-radius: 12px; font-size: 14px; cursor: pointer;
}

/* ===== TELA 4: RESULTADO ===== */
.resultado-container { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.resultado-container img {
    width: 100%; max-width: 380px; border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.btn-baixar {
    width: 100%; background: #F0671E; border: none; color: #fff;
    padding: 16px; border-radius: 14px; font-size: 17px; font-weight: 700; cursor: pointer;
}
.btn-novo {
    width: 100%; background: transparent; border: 1px solid #444; color: #fff;
    padding: 14px; border-radius: 14px; font-size: 15px; cursor: pointer;
}