/* --- RESET E FONTE --- */
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Poppins', 'Segoe UI', sans-serif; background: #f4f7f9; margin: 0; padding: 0; width: 100%; min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; }

/* TELA 1: CONFIGURAÇÃO */
#tela-idiomas { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; z-index: 2000; background-image: url('img/wallpaper_curso.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #bbf0f3; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.box-idiomas-container { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; padding: 20px; }
.titulo-intro { font-size: 26px; font-weight: 700; color: #2d3e40; text-align: center; margin-bottom: 35px; line-height: 1.2; }
.input-card { position: relative; background: white; width: 100%; border-radius: 20px; padding: 15px 20px; display: flex; align-items: center; gap: 15px; margin-bottom: 20px; border: 4px solid #c5f4e8; box-shadow: 0 10px 25px rgba(100, 180, 160, 0.3); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; cursor: pointer; }
.input-card:hover { border-color: #42e695; }
.input-card:active { transform: scale(0.98); border-color: #3bb2b8; }
.flag-icon { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid #f0f0f0; background: #eee; flex-shrink: 0; }
.input-info-wrapper { display: flex; flex-direction: column; flex-grow: 1; }
.input-info-wrapper label { font-size: 12px; color: #888; font-weight: 600; margin-bottom: 2px; }
.selected-text { font-size: 18px; font-weight: 700; color: #333; }
.hidden-select { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.btn-iniciar-jornada { background: linear-gradient(90deg, #42e695 0%, #3bb2b8 100%); color: white; border: none; padding: 18px; font-size: 16px; font-weight: 700; border-radius: 50px; cursor: pointer; width: 100%; margin-top: 25px; box-shadow: 0 10px 20px rgba(66, 230, 149, 0.3); text-transform: uppercase; letter-spacing: 1px; transition: transform 0.2s; }
.btn-iniciar-jornada:active { transform: scale(0.95); }

/* DROPDOWN */
.custom-options-container { position: absolute; top: 105%; left: 0; width: 100%; background: white; border-radius: 20px; box-shadow: 0 15px 30px rgba(66, 230, 149, 0.25); padding: 10px; z-index: 3000; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); max-height: 250px; overflow-y: auto; }
.custom-options-container.open { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-option { display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 12px; cursor: pointer; transition: background 0.2s; color: #555; font-weight: 500; }
.custom-option:hover { background-color: #ecfdf5; color: #0f4c3a; }
.mini-flag { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.custom-options-container::-webkit-scrollbar { width: 6px; }
.custom-options-container::-webkit-scrollbar-track { background: transparent; }
.custom-options-container::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }
@media (min-width: 768px) { .box-idiomas-container { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 25px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); padding: 50px 40px; border: 1px solid rgba(255,255,255,0.8); max-width: 500px; } }

/* TELA 2: NÍVEIS */
#tela-niveis, #tela-subniveis { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: none; flex-direction: column; align-items: center; padding: 30px 15px; overflow-y: auto; -webkit-overflow-scrolling: touch; background-image: url('img/wallpaper_curso.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #bbf0f3; }
#tela-niveis h2, #tela-subniveis h2 { font-size: 24px; font-weight: 700; color: #0f4c3a; margin-bottom: 25px; text-shadow: 0 2px 4px rgba(255,255,255,0.5); }
.content-wrapper { width: 100%; max-width: 800px; display: flex; flex-direction: column; align-items: center; }
.grid-niveis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 15px; width: 100%; margin-bottom: 30px; }
.card-nivel { background: white; padding: 15px 5px; border-radius: 20px; text-align: center; cursor: pointer; position: relative; border: 3px solid #c5f4e8; box-shadow: 0 8px 20px rgba(66, 230, 149, 0.25); transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100px; height: auto; }
.card-nivel:active { transform: scale(0.95); border-color: #3bb2b8; }
.card-nivel h3 { margin: 0 0 5px 0; color: #2d3e40; font-weight: 800; width: 100%; font-size: clamp(16px, 5vw, 22px); line-height: 1.1; word-break: break-word; overflow-wrap: break-word; hyphens: auto; }
.card-nivel p { margin: 0; font-size: 12px; color: #555; font-weight: 500; line-height: 1.2; }
.separator-container { width: 100%; display: flex; align-items: center; justify-content: center; margin: 20px 0 30px 0; color: #555; font-weight: 600; font-size: 14px; }
.separator-container::before, .separator-container::after { content: ''; flex: 1; height: 1px; background: #ccc; margin: 0 15px; }
.legenda-container { width: 100%; max-width: 800px; background: white; border-radius: 50px; border: 3px solid #c5f4e8; box-shadow: 0 8px 20px rgba(66, 230, 149, 0.2); margin-bottom: 30px; overflow: hidden; transition: border-radius 0.3s ease, border-color 0.3s; cursor: pointer; }
.legenda-container.open { border-radius: 25px; border-color: #42e695; }
.legenda-header { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 20px; width: 100%; }
.legenda-titulo-btn { font-weight: 600; color: #2d3e40; font-size: 16px; letter-spacing: 0.5px; }
.icone-teclado { font-size: 20px; }
.seta-expandir { font-size: 12px; color: #888; margin-left: 5px; transition: transform 0.3s; }
.legenda-container.open .seta-expandir { transform: rotate(180deg); }
.legenda-content { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.4s ease-out, opacity 0.3s ease-in; padding: 0 20px; text-align: center; }
.legenda-container.open .legenda-content { max-height: 500px; opacity: 1; padding-bottom: 20px; }
.legenda-subtitulo { display: block; font-weight: 800; color: #0f4c3a; margin: 15px 0 10px 0; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.linha-atalho-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; font-size: 13px; color: #555; margin-bottom: 5px; }
.separador-tracejado { width: 90%; height: 1px; background: none; border-top: 1px dashed #ccc; margin: 15px auto; }
.tecla { background: #eee; border: 1px solid #ccc; border-radius: 6px; padding: 2px 8px; font-family: monospace; font-weight: bold; color: #333; font-size: 12px; display: inline-block; box-shadow: 0 2px 0 #ccc; margin: 0 2px; }
.btn-voltar-outline { background: linear-gradient(90deg, #42e695 0%, #3bb2b8 100%); color: white; border: none; padding: 18px; font-size: 16px; font-weight: 700; border-radius: 50px; cursor: pointer; width: 100%; max-width: 500px; box-shadow: 0 10px 20px rgba(66, 230, 149, 0.3); text-transform: uppercase; letter-spacing: 1px; transition: transform 0.2s; text-align: center; }
.btn-voltar-outline:active { transform: scale(0.95); }

/* TELA 3: LISTA */
#tela-lista { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1500; display: none; flex-direction: column; align-items: center; padding: 15px; background-image: url('img/wallpaper_curso.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #bbf0f3; }
#tela-lista .content-wrapper { height: 100%; overflow: hidden; }
.lista-header { text-align: center; margin-bottom: 15px; flex-shrink: 0; background: white; padding: 15px 20px; border-radius: 20px; width: 100%; max-width: 800px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.lista-header h2 { color: #0f4c3a; font-weight: 800; margin: 0 0 10px 0; }
.lista-controles { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; align-items: center; }
#speed-lista { border: 1px solid #ddd; border-radius: 20px; padding: 8px 12px; background: white; color: #555; font-weight: 500; font-size: 13px; outline: none; cursor: pointer; }
.btn-mini { background: linear-gradient(90deg, #42e695 0%, #3bb2b8 100%); border: none; padding: 8px 16px; border-radius: 20px; font-size: 13px; color: white; font-weight: 700; text-transform: uppercase; box-shadow: 0 4px 10px rgba(66, 230, 149, 0.3); cursor: pointer; transition: transform 0.2s; }
.btn-mini:active { transform: scale(0.95); }
.btn-destaque-mini { background: linear-gradient(90deg, #42e695 0%, #3bb2b8 100%); border-color: transparent; color: white; }
.box-destaque { width: 100%; max-width: 800px; background: #007bff; color: white; border-radius: 15px; text-align: center; margin-bottom: 15px; box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3); opacity: 0; visibility: hidden; height: 0; padding: 0; overflow: hidden; transition: all 0.3s ease-in-out; transform: scale(0.95); flex-shrink: 0; }
.box-destaque.visible { opacity: 1; visibility: visible; height: auto; min-height: 100px; padding: 20px; display: flex; align-items: center; justify-content: center; transform: scale(1); }
#texto-destaque { font-size: 22px; font-weight: 600; margin: 0; line-height: 1.3; word-wrap: break-word; }
#container-lista-itens { width: 100%; max-width: 800px; background: transparent; border-radius: 0; box-shadow: none; border: none; flex-grow: 1; min-height: 0; overflow-y: auto; padding: 5px; margin-bottom: 10px; }
.item-lista { background: white; padding: 18px 20px; margin-bottom: 12px; border-radius: 15px; font-size: 16px; color: #333; display: flex; align-items: center; cursor: pointer; box-shadow: 0 4px 8px rgba(0,0,0,0.03); border: 1px solid transparent; transition: transform 0.1s, box-shadow 0.1s; }
.item-lista:nth-child(even) { background-color: white; }
.item-lista:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.08); }
.item-tocando { background-color: #e0f8e9 !important; border: 1px solid #42e695; color: #0f4c3a; border-left: 1px solid #42e695; }
.num-lista { font-weight: 800; color: #198754; margin-right: 15px; font-size: 1.2rem; min-width: 30px; }
.lista-footer { width: 100%; max-width: 800px; display: flex; gap: 10px; flex-shrink: 0; }
.btn-voltar { background: #666; color: white; border: none; padding: 12px; font-size: 16px; font-weight: bold; border-radius: 8px; flex: 1; }

/* TELA 4: FLASHCARDS */
#tela-estudo { width: 100%; height: 100vh; display: none; flex-direction: column; overflow: hidden; background-image: url('img/wallpaper_curso.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #bbf0f3; }

/* TOP BAR */
.top-bar { width: 100%; height: 60px; background: #2c2f36; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 10px rgba(0,0,0,0.2); color: #fff; flex-shrink: 0; z-index: 100; }
.top-left, .top-right { display: flex; align-items: center; flex-shrink: 0; }
.top-center { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; line-height: 1.1; min-width: 0; padding: 0 5px; overflow: hidden; }
.top-right { gap: 5px; }

.info-nivel { font-size: 11px; color: #42e695; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#contador { color: #aaa !important; font-size: 12px; font-weight: 500; white-space: nowrap; }

.btn-icon-text { background: transparent; border: none; color: #ddd; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 0 5px; }
.speed-control-wrapper { display: flex; align-items: center; gap: 2px; color: #ddd; font-size: 12px; margin-right: 2px; }
.speed-dark { background: transparent; border: none; color: white; font-weight: bold; cursor: pointer; outline: none; font-size: 12px; }
.speed-dark option { background: #333; }

/* BOTÕES ESTUDO */
.btn-intensivo { background: #4a505c; border: 1px solid #666; color: white; border-radius: 5px; padding: 6px 10px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; transition: transform 0.1s, background 0.2s; user-select: none; }
.btn-intensivo:active { transform: scale(0.92); } /* EFEITO DE CLIQUE */
.small-icon { font-size: 16px; }

/* ESTADOS PLAY/PAUSE (OVERRIDES) */
.btn-intensivo-active { background: linear-gradient(90deg, #8b5cf6, #6d28d9) !important; border-color: transparent !important; box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
.btn-super-active { background: linear-gradient(90deg, #ff512f, #dd2476) !important; border-color: transparent !important; box-shadow: 0 0 10px rgba(221, 36, 118, 0.5); }
.btn-paused { background: linear-gradient(90deg, #f59e0b, #d97706) !important; border-color: transparent !important; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

/* RESPONSIVIDADE AGRESSIVA (IPHONE SE) */
@media (max-width: 380px) {
    .label-btn-top { display: none; } 
    .btn-intensivo { padding: 6px 8px; justify-content: center; } 
    .btn-icon-text { padding: 5px; }
    .top-bar { padding: 0 2px; height: 50px; }
    .info-nivel { font-size: 9px; }
    #contador { font-size: 10px; }
    .small-icon { font-size: 14px; }
    .speed-dark { font-size: 10px; }
}

/* CARD */
.estudo-content-wrapper { flex-grow: 1; width: 100%; display: flex; flex-direction: column; padding: 10px; gap: 10px; box-sizing: border-box; overflow: hidden; }
.card { position: relative; width: 100%; flex: 1; min-height: 0; border-radius: 20px; border: none; margin: 0; display: flex; flex-direction: column; transition: transform 0.2s; overflow: hidden; z-index: 1; }
#card-cima { background: linear-gradient(to bottom right, #eef5ff, #dbeafe); box-shadow: 0 4px 0 #aebfd6, 0 10px 10px rgba(0,0,0,0.05); }
#card-baixo { background: linear-gradient(to bottom right, #f0fdf4, #dcfce7); box-shadow: 0 4px 0 #bbf7d0, 0 10px 10px rgba(0,0,0,0.05); }
.bloco-topo { width: 100%; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.idioma-label { font-size: 10px; font-weight: 800; color: #64748b; letter-spacing: 1px; text-transform: uppercase; }
.speed-internal { display: flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800; color: #64748b; }
.speed-mini-transparent { background: transparent; border: none; font-weight: 800; color: #333; cursor: pointer; }
.bloco-meio { width: 100%; flex-grow: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 0 15px; overflow: hidden; }
.texto { width: 100%; text-align: center; word-wrap: break-word; font-weight: 700; color: #1e293b; line-height: 1.1; margin: 0; font-size: 50px; }
.bloco-fundo { width: 100%; height: 45px; position: relative; flex-shrink: 0; }
.btn-circle-play, .btn-circle-stop { position: absolute; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; background-color: #2c2f36; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-circle-play { left: 15px; } 
.btn-circle-stop { right: 15px; }
.btn-circle-play::after { content: ''; display: block; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent white; margin-left: 2px; }
.btn-circle-stop::after { content: ''; display: block; width: 10px; height: 10px; background: white; border-radius: 2px; }
.nav-container-bottom { display: flex; gap: 20px; justify-content: center; padding-bottom: 5px; height: 45px; flex-shrink: 0; }
.btn-nav-neumorphic { background: white; border: none; width: 80px; height: 100%; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; color: #333; cursor: pointer; }
.btn-nav-neumorphic .material-icons-round { font-size: 24px; color: #555; }

/* --- HEADER DE AUTENTICAÇÃO (NOVO) --- */

.auth-container-aligned {
    width: 100%;
    max-width: 400px; /* Mesma largura da caixa de idiomas */
    display: flex;
    justify-content: flex-end; /* Botões à direita */
    gap: 15px;
    margin-bottom: 10px; /* Distância da caixa de baixo */
    padding-right: 15px; /* Alinhamento visual interno similar ao padding do card */
    z-index: 10;
}

/* Botão Entrar */
.btn-auth-text {
    appearance: none; -webkit-appearance: none;
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    color: #0f4c3a !important;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    padding: 8px 12px;
    box-shadow: none !important;
    transition: opacity 0.2s;
}
.btn-auth-text:hover { opacity: 0.7; }

/* Botão Cadastre-se */
.btn-auth-outline {
    appearance: none; -webkit-appearance: none;
    background-color: transparent !important;
    background: transparent !important;
    border: 1px solid #42e695 !important;
    color: #0f4c3a !important;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    padding: 6px 24px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.2s;
}
.btn-auth-outline:hover {
    background-color: #42e695 !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(66, 230, 149, 0.2) !important;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 76, 58, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.modal-card {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 25px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 5px;
}

.modal-header { text-align: center; margin-bottom: 25px; }
.modal-header h2 { margin: 0 0 5px 0; color: #0f4c3a; font-size: 22px; }
.modal-header p { margin: 0; color: #666; font-size: 13px; }

/* Abas */
.auth-tabs {
    display: flex;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: #0f4c3a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Inputs */
.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group .material-icons-round {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 20px;
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #eef0f2;
    border-radius: 15px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: 'Poppins', sans-serif;
}

.input-group input:focus {
    border-color: #42e695;
}

.btn-submit-auth {
    width: 100%;
    background: linear-gradient(90deg, #42e695 0%, #3bb2b8 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 16px;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(66, 230, 149, 0.2);
    transition: transform 0.2s;
}

.btn-submit-auth:active { transform: scale(0.98); }

.auth-footer-text {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 20px;
}
.auth-footer-text span {
    color: #3bb2b8;
    cursor: pointer;
    font-weight: 600;
}