/* ===== DIRECTORES DE AUTOESCUELA - CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #d1fae5;
    --primary-bg: #ecfdf5;
    --bg: #f8faf9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --radius: 1rem;
    --success: #16a34a;
    --error: #dc2626;
    --warning: #f59e0b;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',system-ui,sans-serif; background:var(--bg); color:var(--text); line-height:1.5; min-height:100vh; display:flex; flex-direction:column; }
a { color:var(--primary); text-decoration:none; }
button { cursor:pointer; font-family:inherit; }
.hidden { display:none!important; }

/* Container */
.container { max-width:900px; margin:0 auto; padding:2rem; width:100%; }

/* Buttons */
.primary-btn { background:var(--primary); color:#fff; border:none; padding:0.75rem 1.5rem; border-radius:0.75rem; font-weight:600; font-size:1rem; transition:all 0.2s; }
.primary-btn:hover { background:var(--primary-hover); transform:translateY(-1px); }
.secondary-btn { background:#fff; color:var(--text); border:1px solid var(--border); padding:0.75rem 1.5rem; border-radius:0.75rem; font-weight:500; font-size:1rem; transition:all 0.2s; display:inline-flex; align-items:center; gap:0.5rem; }
.secondary-btn:hover { border-color:var(--primary); color:var(--primary); }
.text-btn { background:none; border:none; color:var(--text-muted); font-weight:500; font-size:0.95rem; transition:color 0.2s; display:inline-flex; align-items:center; gap:0.25rem; }
.text-btn:hover { color:var(--text); }
.back-btn { font-size:1rem; }

/* Card */
.card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:2rem; box-shadow:var(--shadow); }

/* Badges */
.badge { background:var(--primary-light); color:var(--primary); padding:0.25rem 0.75rem; border-radius:2rem; font-size:0.8rem; font-weight:600; }

/* Spinner */
.spinner { width:40px; height:40px; border:3px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin 0.8s linear infinite; margin:2rem auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Loading */
#loading { text-align:center; padding:4rem 0; }
#loading p { color:var(--text-muted); margin-top:1rem; }

/* Toggle Switch */
.practice-mode-toggle { margin-bottom:1.5rem; padding:1rem 1.25rem; background:#fff; border:1px solid var(--border); border-radius:var(--radius); }
.toggle-label { display:flex; align-items:center; gap:0.75rem; cursor:pointer; font-weight:500; }
.toggle-label input { display:none; }
.toggle-switch { width:44px; height:24px; background:var(--border); border-radius:12px; position:relative; transition:background 0.3s; flex-shrink:0; }
.toggle-switch::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; background:#fff; border-radius:50%; transition:transform 0.3s; box-shadow:0 1px 3px rgba(0,0,0,0.15); }
.toggle-label input:checked + .toggle-switch { background:var(--primary); }
.toggle-label input:checked + .toggle-switch::after { transform:translateX(20px); }
.toggle-text small { display:block; color:var(--text-muted); font-weight:400; }

/* ===== LANDING PAGE ===== */
.landing-header { display:flex; justify-content:space-between; align-items:center; padding:1.5rem 2rem; max-width:1200px; margin:0 auto; width:100%; }
.logo { display:flex; align-items:center; gap:0.5rem; font-weight:800; font-size:1.25rem; color:var(--text); }
.logo-icon { font-size:1.5rem; }
.nav-login-btn { color:var(--primary); font-weight:600; padding:0.5rem 1rem; border-radius:0.5rem; transition:background 0.2s; }
.nav-login-btn:hover { background:var(--primary-bg); }

.hero-section { display:grid; grid-template-columns:1fr 1fr; gap:4rem; align-items:center; max-width:1200px; margin:4rem auto; padding:0 2rem; }
.hero-content { display:flex; flex-direction:column; gap:1.5rem; }
.hero-badge { display:inline-block; background:var(--primary-bg); color:var(--primary); font-weight:600; font-size:0.875rem; padding:0.5rem 1rem; border-radius:2rem; width:fit-content; }
.hero-section h1 { font-size:3.5rem; line-height:1.1; font-weight:800; }
.hero-section h1 .highlight { color:var(--primary); background:linear-gradient(120deg, var(--primary-light) 0%, var(--primary-bg) 100%); padding:0 0.5rem; border-radius:0.5rem; }
.hero-subtitle { font-size:1.25rem; color:var(--text-muted); line-height:1.6; max-width:500px; }
.hero-actions { display:flex; gap:1rem; align-items:center; margin-top:1rem; }
.cta-btn { display:inline-flex; align-items:center; gap:0.75rem; background:var(--primary); color:#fff; padding:1rem 2rem; border-radius:0.75rem; font-weight:600; transition:transform 0.2s,box-shadow 0.2s; box-shadow:0 4px 6px -1px rgba(5,150,105,0.2); }
.cta-btn:hover { transform:translateY(-2px); box-shadow:0 10px 15px -3px rgba(5,150,105,0.3); background:var(--primary-hover); color:#fff; }
.google-cta { background:#fff; color:var(--text); border:1px solid var(--border); }
.google-cta:hover { background:#f8faf9; }
.google-cta img { width:20px; height:20px; }
.secondary-cta { color:var(--text-muted); font-weight:600; }
.secondary-cta:hover { color:var(--text); }
.trust-badges { display:flex; gap:1.5rem; margin-top:2rem; font-size:0.875rem; color:var(--text-muted); font-weight:500; }

/* Hero Visual - Block Preview */
.hero-visual { display:flex; justify-content:center; }
.hero-blocks-preview { display:grid; grid-template-columns:1fr 1fr; gap:1rem; max-width:360px; animation:float 6s ease-in-out infinite; }
.preview-block { background:#fff; border:1px solid var(--border); border-radius:1rem; padding:1.5rem; text-align:center; font-weight:600; font-size:0.95rem; box-shadow:var(--shadow); transition:transform 0.3s; }
.preview-block span { display:block; font-size:2rem; margin-bottom:0.5rem; }
.preview-block.b1 { border-left:3px solid #059669; }
.preview-block.b2 { border-left:3px solid #3b82f6; }
.preview-block.b3 { border-left:3px solid #f59e0b; }
.preview-block.b4 { border-left:3px solid #8b5cf6; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }

.features-section { background:#fff; padding:6rem 2rem; margin-top:4rem; }
.section-header { text-align:center; max-width:600px; margin:0 auto 4rem; }
.section-header h2 { font-size:2.5rem; font-weight:800; margin-bottom:1rem; }
.section-header p { font-size:1.25rem; color:var(--text-muted); }
.features-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:2rem; max-width:1200px; margin:0 auto; }
.feature-card { background:var(--bg); padding:2rem; border-radius:1.5rem; transition:transform 0.2s; }
.feature-card:hover { transform:translateY(-5px); }
.feature-icon { font-size:3rem; margin-bottom:1.5rem; background:#fff; width:fit-content; padding:1rem; border-radius:1rem; box-shadow:var(--shadow); }
.feature-card h3 { font-size:1.5rem; font-weight:700; margin-bottom:1rem; }
.feature-card p { color:var(--text-muted); line-height:1.6; }

.landing-footer { background:var(--text); color:#fff; padding:4rem 2rem; margin-top:auto; }
.footer-content { max-width:1200px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; }
.footer-links { display:flex; gap:2rem; }
.footer-links a { color:#94a3b8; transition:color 0.2s; }
.footer-links a:hover { color:#fff; }

/* ===== APP INTERFACE ===== */
.app-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:2rem; padding-bottom:1rem; border-bottom:1px solid var(--border); }
.user-info { display:flex; align-items:center; gap:1rem; font-weight:500; }
.logout-btn { color:var(--text-muted); font-size:0.9rem; }
.logout-btn:hover { color:var(--error); }

/* Dashboard */
.welcome-header { margin-bottom:1.5rem; }
.welcome-header h2 { font-size:1.75rem; font-weight:700; }
.welcome-header p { color:var(--text-muted); }

/* Mode Grid */
.mode-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1.5rem; margin-top:2rem; }
.mode-card { background:#fff; border:1px solid var(--border); border-radius:1rem; padding:2rem; text-align:center; transition:all 0.2s; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:0.75rem; }
.mode-card:hover { border-color:var(--primary); transform:translateY(-4px); box-shadow:var(--shadow); }
.mode-icon { font-size:3rem; }
.mode-card h3 { font-size:1.15rem; }
.mode-card p { color:var(--text-muted); margin-bottom:0.5rem; font-size:0.9rem; }

/* Sub Views */
.sub-view-header { display:flex; align-items:center; gap:1rem; margin-bottom:1.5rem; }
.sub-view-header h3 { font-size:1.5rem; font-weight:700; }

/* Category Stats Grid (Practice Menu) */
.category-stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; }
.cat-stat-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:1.5rem; cursor:pointer; transition:all 0.2s; position:relative; overflow:hidden; }
.cat-stat-card:hover { border-color:var(--primary); transform:translateY(-2px); box-shadow:var(--shadow); }
.cat-stat-card .cat-icon { font-size:2rem; margin-bottom:0.5rem; }
.cat-stat-card .cat-name { font-weight:700; font-size:1.1rem; margin-bottom:0.5rem; }
.cat-stat-card .cat-count { font-size:0.85rem; color:var(--text-muted); margin-bottom:0.75rem; }
.cat-stat-card .progress-bar { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.cat-stat-card .progress-fill { height:100%; background:var(--primary); border-radius:3px; transition:width 0.5s; }
.cat-stat-card .cat-stats-row { display:flex; justify-content:space-between; margin-top:0.5rem; font-size:0.8rem; }
.cat-stat-card .cat-stats-row .correct { color:var(--success); font-weight:600; }
.cat-stat-card .cat-stats-row .incorrect { color:var(--error); font-weight:600; }
.cat-stat-card.b-normativa_escuelas { border-top:3px solid #059669; }
.cat-stat-card.b-tramitacion { border-top:3px solid #3b82f6; }
.cat-stat-card.b-organizacion_empresas { border-top:3px solid #f59e0b; }
.cat-stat-card.b-psicologia { border-top:3px solid #8b5cf6; }

/* Exam Buttons Grid */
.exam-buttons-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; margin-bottom:2rem; }
.exam-launch-btn { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:1.5rem; text-align:center; transition:all 0.2s; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:0.5rem; }
.exam-launch-btn:hover { border-color:var(--primary); transform:translateY(-2px); box-shadow:var(--shadow); }
.exam-launch-btn .icon { font-size:2rem; }
.exam-launch-btn .text { font-weight:700; font-size:1rem; }
.exam-launch-btn .sub { color:var(--text-muted); font-size:0.85rem; }

/* Exam History */
.exam-history h4 { font-size:1.25rem; font-weight:700; margin-bottom:1rem; }
.history-list { display:flex; flex-direction:column; gap:0.75rem; }
.history-item { background:#fff; border:1px solid var(--border); border-radius:0.75rem; padding:1rem 1.25rem; display:flex; justify-content:space-between; align-items:center; cursor:pointer; transition:all 0.2s; }
.history-item:hover { border-color:var(--primary); }
.history-item .hi-info { display:flex; flex-direction:column; gap:0.15rem; }
.history-item .hi-type { font-weight:600; }
.history-item .hi-date { font-size:0.8rem; color:var(--text-muted); }
.history-item .hi-score { font-weight:700; font-size:1.1rem; }
.history-item .hi-score.passed { color:var(--success); }
.history-item .hi-score.failed { color:var(--error); }
.empty-msg { color:var(--text-muted); text-align:center; padding:2rem; font-style:italic; }

/* ===== SESSION VIEW ===== */
.session-nav { display:flex; justify-content:space-between; align-items:center; padding:1rem 1.5rem; background:#fff; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:1.5rem; }
.timer-container { font-size:1.5rem; font-weight:700; font-variant-numeric:tabular-nums; background:var(--bg); padding:0.25rem 1rem; border-radius:0.5rem; }

/* Question Card */
.question-card { animation:fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.question-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:1.5rem; }
.q-number { font-weight:700; font-size:1.1rem; color:var(--text-muted); }
.q-actions { display:flex; align-items:center; gap:1rem; }
.icon-btn { background:none; border:none; font-size:1.5rem; transition:transform 0.2s; padding:0.25rem; }
.icon-btn:hover { transform:scale(1.2); }
.icon-btn.is-favorite { filter:none; }
.icon-btn:not(.is-favorite) { filter:grayscale(100%); opacity:0.4; }
.report-link { font-size:0.85rem; color:var(--text-muted); }
.report-link:hover { color:var(--error); }

.question-text { font-size:1.2rem; font-weight:500; line-height:1.6; margin-bottom:2rem; padding-bottom:1.5rem; border-bottom:1px solid var(--border); }

/* Options */
.options-grid { display:flex; flex-direction:column; gap:0.75rem; }
.option-btn { background:#fff; border:2px solid var(--border); border-radius:0.75rem; padding:1rem 1.25rem; font-size:1rem; text-align:left; transition:all 0.2s; cursor:pointer; display:flex; align-items:flex-start; gap:0.75rem; line-height:1.4; }
.option-btn:hover:not(.disabled) { border-color:var(--primary); background:var(--primary-bg); }
.option-btn .option-key { font-weight:700; color:var(--primary); flex-shrink:0; min-width:1.5rem; }
.option-btn.selected { border-color:var(--primary); background:var(--primary-bg); }
.option-btn.correct { border-color:var(--success); background:#dcfce7; }
.option-btn.incorrect { border-color:var(--error); background:#fee2e2; }
.option-btn.disabled { cursor:default; opacity:0.7; }
.option-btn.disabled:hover { border-color:var(--border); background:#fff; }
.option-btn.correct:hover, .option-btn.incorrect:hover { cursor:default; }

/* Feedback */
.feedback { margin-top:1.5rem; padding:1.25rem; border-radius:0.75rem; animation:fadeIn 0.3s ease; }
.feedback.correct-feedback { background:#dcfce7; border:1px solid #bbf7d0; }
.feedback.incorrect-feedback { background:#fee2e2; border:1px solid #fecaca; }
#feedback-message { font-weight:600; font-size:1.1rem; margin-bottom:0.75rem; }
#feedback-details { margin-top:0.5rem; font-size:0.9rem; color:var(--text-muted); }
#next-practice-btn { margin-top:1rem; }

/* Exam Controls */
.exam-controls { display:flex; justify-content:space-between; margin-top:1.5rem; gap:1rem; }

/* Exam Navigation */
.exam-navigation { display:grid; grid-template-columns:repeat(auto-fill,minmax(40px,1fr)); gap:0.5rem; padding:1rem; background:#fff; border:1px solid var(--border); border-radius:var(--radius); margin-top:1rem; }
.nav-btn { width:40px; height:40px; border:1px solid var(--border); border-radius:0.5rem; background:#fff; font-weight:600; font-size:0.9rem; cursor:pointer; transition:all 0.15s; display:flex; align-items:center; justify-content:center; }
.nav-btn:hover { border-color:var(--primary); }
.nav-btn.current { border-color:var(--primary); background:var(--primary); color:#fff; }
.nav-btn.answered { background:var(--primary-light); border-color:var(--primary); color:var(--primary); }
.nav-btn.correct-nav { background:#dcfce7; border-color:var(--success); color:var(--success); }
.nav-btn.incorrect-nav { background:#fee2e2; border-color:var(--error); color:var(--error); }
.finish-btn { width:100%; margin-top:1rem; padding:1rem; font-size:1.1rem; }

/* ===== RESULTS ===== */
.results-card { max-width:600px; margin:2rem auto; text-align:center; background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:3rem 2rem; box-shadow:var(--shadow); }
.results-card h2 { font-size:1.75rem; font-weight:700; margin-bottom:2rem; }
.score-circle { width:140px; height:140px; border-radius:50%; background:var(--primary-bg); border:4px solid var(--primary); display:flex; flex-direction:column; align-items:center; justify-content:center; margin:0 auto 1.5rem; }
.score-circle span:first-child { font-size:2.5rem; font-weight:800; color:var(--primary); }
.score-label { font-size:0.8rem; color:var(--text-muted); }
.pass-fail-msg { font-size:1.25rem; font-weight:700; margin-bottom:2rem; }
.pass-fail-msg.passed { color:var(--success); }
.pass-fail-msg.failed { color:var(--error); }
.results-stats { display:flex; justify-content:center; gap:2rem; margin-bottom:2rem; }
.stat-item { display:flex; flex-direction:column; align-items:center; gap:0.25rem; }
.stat-val { font-size:1.75rem; font-weight:800; }
.stat-val.green { color:var(--success); }
.stat-val.red { color:var(--error); }
.stat-val.gray { color:var(--text-muted); }
.stat-label { font-size:0.85rem; color:var(--text-muted); }
.results-actions { display:flex; gap:1rem; justify-content:center; }

/* ===== 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; backdrop-filter:blur(4px); }
.modal-card { background:#fff; padding:2rem; border-radius:1rem; width:90%; max-width:500px; box-shadow:0 20px 25px -5px rgba(0,0,0,0.1); }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:1.5rem; }
.modal-header h3 { font-size:1.5rem; font-weight:700; }
.close-modal-btn { background:none; border:none; font-size:1.5rem; cursor:pointer; color:var(--text-muted); }
.form-group { margin-bottom:1.5rem; }
.form-group label { display:block; margin-bottom:0.5rem; font-weight:500; }
.form-group select, .form-group textarea { width:100%; padding:0.75rem; border:1px solid var(--border); border-radius:0.5rem; font-family:inherit; font-size:1rem; }
.form-group textarea { resize:vertical; }
.modal-actions { display:flex; justify-content:flex-end; gap:1rem; }

/* ===== RESPONSIVE ===== */
@media(max-width:768px) {
    html { font-size:14px; }
    .container { padding:1rem; }
    .landing-header { flex-direction:column; gap:1rem; padding:1rem; }
    .hero-section { grid-template-columns:1fr; text-align:center; gap:2rem; margin:2rem auto; padding:0 1rem; }
    .hero-content { align-items:center; }
    .hero-section h1 { font-size:2.25rem; }
    .hero-subtitle { font-size:1rem; }
    .hero-actions { flex-direction:column; width:100%; }
    .cta-btn { width:100%; justify-content:center; }
    .trust-badges { flex-direction:column; gap:0.5rem; align-items:center; }
    .features-section { padding:4rem 1rem; }
    .features-grid { grid-template-columns:1fr; }
    .landing-footer { padding:3rem 1rem; text-align:center; }
    .footer-content { flex-direction:column; gap:2rem; }
    .footer-links { flex-direction:column; gap:1rem; }
    .app-header { flex-direction:column; gap:1rem; align-items:flex-start; }
    .user-info { width:100%; justify-content:space-between; }
    .mode-grid { grid-template-columns:1fr 1fr; }
    .exam-buttons-grid { grid-template-columns:1fr; }
    .session-nav { flex-wrap:wrap; gap:0.5rem; padding:0.75rem 1rem; }
    .nav-center { order:-1; width:100%; display:flex; justify-content:center; margin-bottom:0.5rem; }
    .nav-left,.nav-right { flex:1; }
    .question-header { flex-direction:column; align-items:flex-start; gap:0.5rem; }
    .q-actions { width:100%; justify-content:space-between; }
    .option-btn { padding:1rem; font-size:1.1rem; min-height:60px; }
    .exam-controls { gap:1rem; }
    .secondary-btn { flex:1; padding:1rem; font-size:1.1rem; justify-content:center; display:flex; }
    .exam-navigation { grid-template-columns:repeat(auto-fill,minmax(45px,1fr)); gap:0.75rem; }
    .nav-btn { width:45px; height:45px; font-size:1.1rem; }
    .results-stats { flex-direction:row; gap:1.5rem; }
    .category-stats-grid { grid-template-columns:1fr 1fr; }
}

@media(max-width:480px) {
    .mode-grid { grid-template-columns:1fr; }
    .category-stats-grid { grid-template-columns:1fr; }
}

.loading-placeholder { text-align:center; padding:3rem; color:var(--text-muted); }

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner { position:fixed; bottom:0; left:0; right:0; z-index:9999; background:rgba(30,41,59,0.95); backdrop-filter:blur(10px); padding:1rem 2rem; display:flex; justify-content:center; animation:slideUp 0.4s ease; }
@keyframes slideUp { from{transform:translateY(100%);opacity:0} to{transform:translateY(0);opacity:1} }
.cookie-content { max-width:1000px; width:100%; display:flex; align-items:center; gap:1.5rem; }
.cookie-text { display:flex; align-items:flex-start; gap:0.75rem; flex:1; }
.cookie-icon { font-size:1.75rem; flex-shrink:0; }
.cookie-text p { color:#e2e8f0; font-size:0.9rem; line-height:1.5; margin:0; }
.cookie-text a { color:var(--primary-light); text-decoration:underline; }
.cookie-text a:hover { color:#fff; }
.cookie-actions { flex-shrink:0; }
.cookie-accept-btn { background:var(--primary); color:#fff; border:none; padding:0.65rem 1.75rem; border-radius:0.5rem; font-weight:600; font-size:0.95rem; cursor:pointer; transition:all 0.2s; white-space:nowrap; }
.cookie-accept-btn:hover { background:var(--primary-hover); transform:translateY(-1px); }

@media(max-width:768px) {
    .cookie-content { flex-direction:column; gap:1rem; }
    .cookie-text { flex-direction:column; text-align:center; align-items:center; }
    .cookie-accept-btn { width:100%; }
}

/* ===== LEGAL PAGES ===== */
.card h2 { font-size:1.75rem; font-weight:700; margin-bottom:1rem; color:var(--text); }
.card h3 { font-size:1.15rem; font-weight:600; margin:1.5rem 0 0.5rem; color:var(--text); }
.card p { line-height:1.7; margin-bottom:0.75rem; color:#475569; }
.card ul { margin:0.5rem 0 1rem 1.5rem; }
.card ul li { margin-bottom:0.4rem; line-height:1.6; color:#475569; }
.card a { color:var(--primary); text-decoration:underline; }
.card a:hover { color:var(--primary-hover); }
