/* =========================================================================
   Estilos Principales Web App IVCA (Paso a Paso Tesis)
   Estilo Visual: Android Material Design 3 (Azul Primario #154ec1, Verde Éxito #00c853)
   ========================================================================= */

:root {
    --primary: #154ec1;
    --primary-hover: #0f3ba1;
    --primary-light: #eef4ff;
    --secondary: #0f172a;
    --success: #00c853;
    --success-hover: #00a844;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --border: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow: 0 4px 12px rgba(21, 78, 193, 0.12);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar / App Toolbar */
.app-navbar {
    background-color: var(--primary);
    color: var(--text-white);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.app-navbar-brand svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Viewport Contenedor Principal */
.app-viewport {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
}

/* Vistas de Pantallas (Single Page App) */
.view-screen {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.25s ease-in-out;
}

.view-screen.active {
    display: block;
}

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

/* Formularios & Inputs estilo Material Design */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-dark);
    background: #ffffff;
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Botón Verde Guardar (Resaltado y visible para el usuario) */
.btn-success {
    background-color: var(--success) !important;
    color: var(--text-white) !important;
    box-shadow: 0 4px 14px rgba(0, 200, 83, 0.35) !important;
}

.btn-success:hover {
    background-color: var(--success-hover) !important;
    box-shadow: 0 6px 18px rgba(0, 200, 83, 0.45) !important;
}

.btn-danger {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-danger:hover {
    background-color: #fca5a5;
    color: #991b1b;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

/* Tarjeta de Perfil Guardado (Lista RecyclerView) */
.profile-card {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.profile-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.profile-status-badge {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-card.elaboracion .profile-status-badge {
    background-color: #fef3c7;
    color: #d97706;
}

.profile-card.terminado .profile-status-badge {
    background-color: #dcfce7;
    color: #15803d;
}

/* Step Header & Indicador de Pasos */
.stepper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--border);
}

.stepper-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Tabla Matriz de Congruencia (Paso 7) */
.matrix-table-view {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.matrix-table-view th, .matrix-table-view td {
    border: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.95rem;
}

.matrix-table-view th {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

/* Notificación Toast flotante */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
    opacity: 0;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsividad para móviles */
@media (max-width: 600px) {
    .view-screen {
        padding: 20px 16px;
    }
    .app-navbar {
        padding: 12px 16px;
    }
}
