
/* Reset e box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores base */
    --primary-color: #000000;
    --secondary-color: #ff6b81;
    --light-pink: #ffb6c1;
    --background-color: #eed7dd;
    --text-color: #555;
    --white: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
    
    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', serif;
    --font-cursive: 'Dancing Script', cursive;
    --font-serif: 'Cormorant Garamond', serif;
    --font-special: 'Julius Sans One', sans-serif;
}

/* Estilos base do body */
body {
    font-family: var(--font-primary);
    background: white;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 120px 0 0;
    background: linear-gradient(135deg, #f5f7fa 0%, var(--background-color) 100%);
}

/* ============================================
   TIPOGRAFIA
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ============================================
   LAYOUT GERAL
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Editor container */
.editor-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 100px;
    align-items: flex-start;
    margin-top: 50px;
}

/* Form section */
.form-section {
    flex: 1 1 500px;
    min-width: 300px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    order: 1;
}

/* Preview section */
.preview-section {
    flex: 1 1 500px;
    min-width: 300px;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 20px;
    order: 2;
}

/* ============================================
   COMPONENTES REUTILIZÁVEIS
   ============================================ */

/* Header */
.header {
    padding: 10px 2rem;
    padding-left: 10px;
    padding-right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: absolute;
    align-items: center;
    width: 80%;
    left: 10%;
    top: 20px;
    z-index: 1000;
    border-radius: 100px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 182, 193, 0.2);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 135px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Botões */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--medium-gray);
    color: var(--dark-gray);
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--primary-color);
    color: white;
    padding: 14px 25px;
}

.btn-success:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* CTA Button específico */
.cta-button-Pr {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 10px 25px;
    font-size: 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    font-family: var(--font-heading);
    border: 2px solid transparent;
}

.cta-button-Pr:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
    background: transparent;
    color: rgba(0, 0, 0, 0.621);
    border-color: white;
}

/* Formulários */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--white);
    font-family: var(--font-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Counter Controls */
.counter-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.counter-btn {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    background: white;
    color: var(--dark-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.counter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Field Group */
.field-group {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
}

.field-group h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

/* Optional Section */
.optional-section {
    background: rgba(255, 182, 193, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.toggle-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Color Palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.05);
}

/* Color Picker */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 182, 193, 0.05);
    border-radius: 8px;
    border: 1px solid var(--medium-gray);
}

.color-picker {
    width: 60px;
    height: 60px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.color-picker:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.color-picker:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.color-info {
    flex: 1;
}

.color-code {
    display: inline-block;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--dark-gray);
    min-width: 80px;
    text-align: center;
    margin-bottom: 5px;
}

.color-hint {
    color: var(--dark-gray);
    font-size: 0.85rem;
    display: block;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--medium-gray);
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 182, 193, 0.1);
}

.image-upload:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.upload-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 15px;
    border-radius: 8px;
    display: none;
    border: 3px solid var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Multiple Image Upload */
.multiple-image-upload {
    border: 2px dashed var(--medium-gray);
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 182, 193, 0.1);
    margin-bottom: 15px;
}

.multiple-image-upload:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.remove-image-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.add-image-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--medium-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 182, 193, 0.1);
    font-size: 24px;
    color: var(--primary-color);
}

.add-image-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.upload-info {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Promise Item Editor */
.promise-item-editor {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.promise-input {
    flex: 1;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

/* Progress */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 4px;
    background: var(--medium-gray);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--dark-gray);
}

/* Navigation */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 10px;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-title i {
    color: var(--primary-color);
}

.dynamic-fields {
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 15px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.modal-content p {
    color: var(--dark-gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Form Header */
.form-header {
    background: var(--white);
    color: var(--primary-color);
    padding: 25px 30px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.form-header h2 {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-header p {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* ============================================
   ESTADOS (.active, .selected, :hover)
   ============================================ */

.step-content.active {
    display: block;
}

.color-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none;
}

/* ============================================
   ANIMAÇÕES REUTILIZÁVEIS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseBackground {
    0% {
        background-color: var(--background-color);
    }

    100% {
        background-color: #f8e1e6;
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes rotateMessage {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    30% {
        opacity: 0;
        transform: translateY(-15px);
    }

    100% {
        opacity: 0;
        transform: translateY(-15px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVIDADE GLOBAL
   ============================================ */

@media (max-width: 1024px) {
    .preview-section {
        position: static;
        order: 2;
    }

    .form-section {
        flex: 0 1 100%;
        max-width: 100%;
        order: 2;
    }
}

@media (max-width: 768px) {
    body {
        padding: 45px 0 0;
    }

    .color-picker-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .color-picker {
        width: 50px;
        height: 50px;
    }

    .color-code {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .form-section {
        max-width: 100%;
    }

    .form-body {
        padding: 20px 15px;
    }

    .form-header {
        padding: 20px 15px;
    }

    .form-header h2 {
        font-size: 1.3rem;
    }

    .step-title {
        font-size: 1.1rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .modal-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .color-picker-container {
        padding: 12px;
    }

    .color-picker {
        width: 45px;
        height: 45px;
    }

    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-body {
        padding: 15px 10px;
    }

    .step-title {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .form-header {
        padding: 15px 10px;
    }

    .form-header h2 {
        font-size: 1.2rem;
    }

    .logo {
        display: flex;
        align-items: center;
        width: 90px;
    }

    .cta-button-Pr {
        padding: 10px 10px;
        font-size: 0.7rem;
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */

.emoji-input {
    font-size: 24px;
    text-align: center;
    max-width: 60px;
}

/* ============================================
   QUEBRA DE PALAVRAS GLOBAL
   ============================================ */

.form-control,
.declaration-title,
.declaration-text,
.plan-title,
.plan-text,
.promise-item,
.video-message,
.simple-counter p,
.section-divider,
.message,
.title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}