:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #4b5563;
    --secondary-hover: #374151;
    --text-main: #111827;
    --text-muted: #6b7280;
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --error: #ef4444;
    --success: #10b981;
    --info-bg: #eff6ff;
    --info-text: #1e3a8a;
    --info-border: #bfdbfe;

    /* Act Colors */
    --color-fin: #2563eb; /* Azul */
    --color-soc: #059669; /* Verde */
    --color-amb: #d97706; /* Ambar */
    
    /* Dynamic Accent Color based on current act */
    --current-accent: var(--primary);

    /* Shadows & Border Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }
.italic { font-style: italic; }

/* Header */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--current-accent);
    transition: color 0.3s ease;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 200px;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--current-accent);
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Main Layout */
.main-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.screen {
    animation: fadeIn 0.4s ease-out forwards;
}

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

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-header, .card-footer {
    padding: 1.25rem 1.5rem;
    background-color: var(--bg-card);
}

.card-header {
    border-bottom: 1px solid var(--border);
}

.card-footer {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

.card-body {
    padding: 1.5rem;
}

.glass-card {
    /* Optional slight glass effect if desired, standard for now */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Typography & Badges */
.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.acto-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--current-accent);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.scenario-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--border);
    color: var(--text-muted);
}

.badge-lg {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.info-box {
    background-color: var(--info-bg);
    border-left: 4px solid var(--info-border);
    padding: 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--info-text);
    font-size: 0.875rem;
}

/* Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.data-item {
    background-color: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.data-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Form Elements */
.decision-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--current-accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(0.9);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--current-accent);
    color: var(--current-accent);
    background-color: var(--bg-main);
}

.btn-outline.selected {
    background-color: var(--current-accent);
    border-color: var(--current-accent);
    color: white;
}

.textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.textarea:focus {
    outline: none;
    border-color: var(--current-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.word-count-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.word-count {
    color: var(--text-muted);
    font-weight: 500;
}

.word-error {
    color: var(--error);
    font-weight: 600;
}

.textarea.error {
    border-color: var(--error);
}

/* Feedback Card */
.feedback-card {
    background-color: #f0fdf4; /* Light green tint by default, can be dynamic */
    border-color: #bbf7d0;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #166534;
}

.feedback-icon {
    font-size: 1.25rem;
}

.feedback-text {
    color: #14532d;
    font-size: 0.875rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 250px;
}

/* Log Container */
.log-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.log-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    border-left: 4px solid var(--border);
}

.log-item h5 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.log-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.log-item .log-feedback {
    background-color: white;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}
