/* NexusFlow Premium Dark Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === TELA DE AUTENTICAÇÃO === */
#auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    margin-bottom: 1rem;
    color: #8b5cf6;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-header .subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
}

.auth-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.auth-form input::placeholder {
    color: #64748b;
}

.auth-form .btn {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.auth-info {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-info p {
    color: #94a3b8;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.auth-info strong {
    color: #e2e8f0;
}

/* Dark Theme Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #1e1e2e;
    --bg-modal: #242438;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-gold: #f59e0b;
    --accent-red: #ef4444;
    --border-primary: #27272a;
    --border-secondary: #3f3f46;
    --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-purple: 0 4px 20px rgba(139, 92, 246, 0.2);
    --shadow-blue: 0 4px 20px rgba(59, 130, 246, 0.2);
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #1e1e2e 0%, #242438 100%);
    --gradient-card: linear-gradient(135deg, #1a1a24 0%, #1e1e2e 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Premium Background with animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Premium Header */
.header {
    background: var(--gradient-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-dark);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Screen Management */
.screen {
    flex: 1;
    padding: 2rem;
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Cards */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 2rem;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: var(--shadow-dark);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.5;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Premium Template Cards */
.template-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-dark);
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.template-card:hover::before {
    opacity: 0.05;
}

.template-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-purple);
}

.template-card.selected {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-purple);
    transform: translateY(-4px);
}

.template-card * {
    position: relative;
    z-index: 1;
}

.template-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.3));
}

.template-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.template-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.template-card.featured {
    background: linear-gradient(135deg, #1a1a24 0%, #2d1b69 50%, #1e1e2e 100%);
    border-color: var(--accent-gold);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2);
}

.template-card.featured:hover {
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.3);
}

.template-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"], textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-secondary);
}

.responsible-input, .consultant-input {
    margin-bottom: 1rem;
}

/* Campos dependentes */
.dependent-field {
    margin-left: 20px;
    border-left: 3px solid var(--accent-purple);
    padding-left: 15px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.dependent-field.field-visible {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Premium Buttons */
.btn-primary, .btn-secondary, .btn-add, .btn-back {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-modal);
    border-color: var(--accent-purple);
    transform: translateY(-1px);
}

.btn-add {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-back {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
    border-radius: 16px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Meeting Interface */
.meeting-header {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meeting-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-red);
    font-weight: 600;
    font-size: 0.9rem;
}

.recording-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.meeting-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.speech-section h3, .form-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.speech-output {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.speech-controls {
    margin-top: 1rem;
}

.btn-speech {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-speech.active {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    border-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-speech:hover {
    background: var(--bg-modal);
    border-color: var(--accent-purple);
}

.dynamic-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.form-item:hover {
    border-color: var(--border-secondary);
    background: var(--bg-modal);
}

.form-item label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-purple);
}

.meeting-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Review Section */
.review-header {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-primary);
    text-align: center;
}

.meeting-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.review-form {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-primary);
}

.review-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Signature Section */
.signature-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.signature-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.signatures-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.signature-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.signature-item:hover {
    border-color: var(--border-secondary);
    background: var(--bg-modal);
}

.signature-item.signed {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(16, 185, 129, 0.05));
}

.signature-preview {
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: white;
    margin: 0 1rem;
}

.btn-sign {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-sign:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.btn-sign:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.signature-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
}

.completion-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal de assinatura mobile em tela cheia */
.modal.mobile-fullscreen {
    background: rgba(0, 0, 0, 0.95);
}

.modal.mobile-fullscreen .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.mobile-fullscreen .modal-header {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.modal.mobile-fullscreen .signature-pad-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.modal.mobile-fullscreen #signature-pad {
    border: 3px solid #8b5cf6 !important;
    border-radius: 15px !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.modal.mobile-fullscreen .signature-modal-actions {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
}

.modal.mobile-fullscreen .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.signature-pad-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    border: 2px solid var(--border-primary);
}

#signature-pad {
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
}

.signature-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.step-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

#selected-template-title {
    color: var(--accent-purple);
    font-weight: 700;
}

/* Form Section Blocks - Dark Theme */
.form-section-block {
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-section-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.3;
}

.form-section-block:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.section-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-fields {
    display: grid;
    gap: 1rem;
}

.form-section-block .form-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.form-section-block .form-item:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    background: var(--bg-modal);
}

.form-section-block .form-item label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Campos pré-preenchidos - Dark Theme */
.form-section-block .form-item input[readonly]:not([value=""]) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: var(--accent-green);
    color: var(--accent-green);
    font-weight: 600;
}

.form-section-block .form-item:has(input[readonly]:not([value=""])) {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(16, 185, 129, 0.05));
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.form-section-block .form-item:has(input[readonly]:not([value=""])) label {
    color: var(--accent-green);
}

.form-section-block .form-item:has(input[readonly]:not([value=""])) label::after {
    content: " ✓";
    color: var(--accent-green);
    font-weight: bold;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

/* Progress Indicator - Dark Theme */
.progress-indicator {
    background: var(--gradient-primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: var(--shadow-purple);
    position: relative;
    overflow: hidden;
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: progressShine 3s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent-green), #34d399);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.progress-tip {
    font-style: italic;
    color: var(--accent-gold);
    text-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

/* CSM Alerts - Dark Theme */
.csm-alerts-container {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
}

.csm-alerts-header h4 {
    color: var(--accent-red);
    margin: 0 0 1rem 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.csm-alert {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--accent-red);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    color: #fca5a5;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.csm-alert:last-child {
    margin-bottom: 0;
}

/* CSM Insights */
.csm-insights-container {
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    display: none;
    box-shadow: var(--shadow-dark);
}

.csm-insights-header h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.csm-insight {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.csm-insight:hover {
    transform: translateX(4px);
}

.csm-insight-opportunity {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--accent-gold);
}

.csm-insight-action {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-blue);
}

.csm-insight-growth {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--accent-green);
}

.csm-insight-analysis {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--accent-purple);
}

.csm-insight-efficiency {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--accent-red);
}

.insight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.insight-message {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.csm-insight:last-child {
    margin-bottom: 0;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .screen {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
        margin: 0 0.5rem;
        border-radius: 16px;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .template-card {
        padding: 1.5rem;
    }
    
    .meeting-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .meeting-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.25rem;
    }
    
    .meeting-actions,
    .review-actions,
    .signature-actions,
    .completion-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .signature-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-item {
        padding: 1.25rem;
    }
    
    .signature-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.25rem;
    }
    
    .signature-sections {
        grid-template-columns: 1fr;
    }
    
    .meeting-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .form-section-block {
        padding: 1.25rem;
    }
    
    .progress-indicator {
        padding: 1.25rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }
    
    .logo-container h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .screen {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1.25rem;
        margin: 0 0.25rem;
    }
    
    .template-card {
        padding: 1.25rem;
    }
    
    .template-icon {
        font-size: 2.5rem;
    }
    
    .btn-primary, .btn-secondary, .btn-add, .btn-back {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 1.125rem 2rem;
        font-size: 1rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    #signature-pad {
        height: 150px;
    }
    
    .speech-output {
        height: 150px;
        padding: 1rem;
    }
    
    .form-item {
        padding: 1rem;
    }
    
    .meeting-header {
        padding: 1rem;
    }
    
    .form-section-block {
        padding: 1rem;
    }
    
    .progress-indicator {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn-primary, .btn-secondary, .btn-add, .btn-back, .btn-sign, .btn-speech {
        min-height: 48px;
        padding: 1rem 1.5rem;
    }
    
    .template-card {
        min-height: 120px;
        padding: 1.5rem;
    }
    
    input[type="text"], textarea {
        min-height: 48px;
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .checkbox-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .signature-item {
        min-height: 80px;
    }
}

/* AI Complete Button */
.btn-ai-complete {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-ai-complete:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-test-api {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-test-api:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

/* Footer */
.app-footer {
    background: var(--gradient-secondary);
    border-top: 1px solid var(--border-primary);
    padding: 1rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.8;
}

.footer-content a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.footer-content a:hover {
    color: var(--accent-blue);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Botão de Instalação PWA */
.install-pwa-btn {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-purple) !important;
}

.install-pwa-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4) !important;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .header,
    .app-footer,
    .meeting-actions,
    .review-actions,
    .signature-actions,
    .completion-actions {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
    }
}

/* Notificações de Atualização PWA */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1a1a24 0%, #2a2a3a 100%);
    border: 1px solid var(--accent-purple);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    z-index: 10000;
    max-width: 350px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.update-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
    position: relative;
}

.update-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.update-text h4 {
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.update-text p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.btn-update {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-update:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Notificação de Sucesso */
.update-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    z-index: 10000;
    max-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-success-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.success-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.success-icon {
    font-size: 20px;
}

.success-text h4 {
    color: white;
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
}

.success-text p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 12px;
}

/* Responsividade Mobile para Notificações */
@media (max-width: 480px) {
    .update-notification,
    .update-success-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .update-notification.show,
    .update-success-notification.show {
        transform: translateY(0);
    }
    
    .update-content,
    .success-content {
        padding: 16px;
        gap: 12px;
    }
    
    .update-text,
    .success-text {
        flex: 1;
    }
}

/* Notificação Jettax */
.jettax-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
    z-index: 10000;
    max-width: 320px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.jettax-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.jettax-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.jettax-icon {
    font-size: 20px;
    animation: bounce 1.5s infinite;
}

.jettax-text h4 {
    color: white;
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
}

.jettax-text p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 12px;
}

/* Responsividade Mobile para Jettax */
@media (max-width: 480px) {
    .jettax-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .jettax-notification.show {
        transform: translateY(0);
    }
    
    .jettax-content {
        padding: 14px 16px;
        gap: 10px;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-btn {
    background: var(--gradient-secondary) !important;
    border: 1px solid var(--accent-blue) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.history-btn:hover {
    background: var(--accent-blue) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Notificação de Campo Preenchido */
.field-filled-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.3);
    z-index: 9999;
    max-width: 300px;
    opacity: 0;
    transform: translateX(350px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-filled-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.field-filled-content {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
}

.field-filled-icon {
    font-size: 18px;
}

.field-filled-text h4 {
    color: white;
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
}

.field-filled-text p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 11px;
}

/* Notificação de Duração */
.duration-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
    z-index: 10000;
    max-width: 280px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.duration-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.duration-icon {
    font-size: 20px;
}

.duration-text h4 {
    color: white;
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
}

.duration-text p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 12px;
}

/* Modal de Histórico */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.history-modal.show {
    opacity: 1;
}

.history-modal-content {
    background: var(--gradient-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-primary);
    background: var(--gradient-primary);
}

.history-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-close-history {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-history:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-content {
    padding: 1.5rem 2rem;
    max-height: 50vh;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.history-empty h3 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.history-item {
    background: var(--gradient-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-item-header h4 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.history-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.history-detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-detail strong {
    color: var(--text-primary);
}

.history-item-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-view-details {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-details:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-primary);
    background: var(--gradient-tertiary);
}

.history-footer p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
}

.btn-export-history {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-export-history:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Notificação de Export */
.export-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.4);
    z-index: 10000;
    max-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.export-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.export-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.export-icon {
    font-size: 20px;
}

.export-text h4 {
    color: white;
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
}

.export-text p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 12px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .header-actions {
        gap: 0.5rem;
    }
    
    .history-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .history-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .history-header {
        padding: 1rem 1.5rem;
    }
    
    .history-content {
        padding: 1rem 1.5rem;
    }
    
    .history-item-details {
        grid-template-columns: 1fr;
    }
    
    .history-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .field-filled-notification,
    .duration-notification,
    .export-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .field-filled-notification.show,
    .duration-notification.show,
    .export-notification.show {
        transform: translateY(0);
    }
} 