/* Tema Feminino (Padrão) */
body[data-theme="feminino"] {
    --primary: #be185d;
    --primary-hover: #9d174d;
    --secondary: #ec4899;
    --accent: #7c3aed;
    --header-gradient: linear-gradient(135deg, #be185d, #7c3aed);
    --bg-color: #fdf2f8;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #fbcfe8;
    --badge-bg: rgba(236, 72, 153, 0.12);
    --badge-border: #f472b6;
    --badge-text: #be185d;
    --chip-bg: #fdf2f8;
    --chip-border: #fbcfe8;
    --chip-text: #9d174d;
    --chip-hover: #fce7f3;
    --toolbar-bg: rgba(255, 255, 255, 0.94);
    --toolbar-border: #fce7f3;
}

/* Tema Masculino */
body[data-theme="masculino"] {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --secondary: #38bdf8;
    --accent: #1e3a8a;
    --header-gradient: linear-gradient(135deg, #1e3a8a, #0284c7);
    --bg-color: #f0f9ff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #bae6fd;
    --badge-bg: rgba(2, 132, 199, 0.12);
    --badge-border: #38bdf8;
    --badge-text: #0369a1;
    --chip-bg: #f0f9ff;
    --chip-border: #bae6fd;
    --chip-text: #0369a1;
    --chip-hover: #e0f2fe;
    --toolbar-bg: rgba(255, 255, 255, 0.94);
    --toolbar-border: #e0f2fe;
}

:root {
    --border-radius: 16px;
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px 16px 85px 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

.app-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

header {
    background: var(--header-gradient);
    color: white;
    padding: 24px 20px 18px;
    text-align: center;
    transition: var(--transition);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.step-badge {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
}

.progress-bar {
    height: 100%;
    background: white;
    width: 20%;
    transition: width 0.4s ease;
}

main {
    padding: 24px 20px;
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step {
    display: none;
    flex: 1;
    animation: fadeIn 0.35s ease forwards;
}

.step.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

h2 {
    font-size: 1.22rem;
    margin-bottom: 6px;
    color: var(--primary);
    transition: color 0.3s ease;
}

p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
}

/* Sugestões de Respostas (Chips) */
.suggestions-wrapper {
    margin-bottom: 12px;
}

.suggestions-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 110px;
    overflow-y: auto;
    padding: 2px;
}

.chip {
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    color: var(--chip-text);
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    display: inline-flex;
    align-items: center;
    line-height: 1.3;
}

.chip:hover {
    background: var(--chip-hover);
    transform: translateY(-1px);
}

.chip:active {
    transform: scale(0.96);
}

.input-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.custom-style-container {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Textareas Auto-Expansíveis (de 2 em 2 linhas) */
textarea.auto-expand {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.96rem;
    line-height: 1.5;
    color: var(--text-main);
    background: #ffffff;
    margin-bottom: 16px;
    transition: border-color 0.2s ease, height 0.15s ease;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

textarea.auto-expand:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.btn {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    flex: 1;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.03);
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.style-badge {
    background: #f1f5f9;
    color: var(--text-main);
    padding: 9px 6px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    user-select: none;
}

.style-badge:hover {
    background: #e2e8f0;
}

.style-badge.selected {
    background: var(--badge-bg);
    color: var(--badge-text);
    border-color: var(--badge-border);
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: -6px;
    margin-bottom: 14px;
    display: none;
    animation: fadeIn 0.3s;
}

/* Review Box */
.review-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.review-box p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

.review-box p:last-child {
    margin-bottom: 0;
}

.review-box strong {
    color: var(--primary);
    display: inline-block;
    min-width: 75px;
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading .btn-text {
    display: none;
}
.loading .spinner {
    display: block;
}

/* Sucesso & 404 */
#step-success, #error-404 {
    text-align: center;
    align-items: center;
    justify-content: center;
}

.icon-big {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

/* Barra Fixa no Rodapé */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--toolbar-bg);
    border-top: 1px solid var(--toolbar-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
}

.toolbar-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.toolbar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.theme-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.theme-btn:hover:not(.active) {
    background: #e2e8f0;
}
