/* ============================================
   MANTIX — Sistema de Diseño v2
   Modo claro/oscuro · Blue accent · Universal
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── TEMA OSCURO (default) ──────────────────── */
:root {
    --bg:          #0d0d0f;
    --bg2:         #141417;
    --bg3:         #1c1c21;
    --bg4:         #222228;
    --border:      #2a2a32;
    --border2:     #3a3a45;
    --text:        #e8e8f0;
    --text2:       #9090a8;
    --text3:       #5a5a70;

    --red:         #ff4757;
    --red-dim:     #2a1219;
    --yellow:      #ffa502;
    --yellow-dim:  #2a2010;
    --green:       #2ed573;
    --green-dim:   #0f2a1a;
    --blue:        #3d8bff;
    --blue-dim:    #0f1e3a;

    --accent:      #3d8bff;
    --accent-hover:#5a9fff;
    --accent-glow: rgba(61,139,255,0.15);
    --accent-glow2:rgba(61,139,255,0.25);

    --font-mono:   'Space Mono', monospace;
    --font-body:   'Plus Jakarta Sans', sans-serif;

    --radius:      10px;
    --radius-lg:   16px;
    --radius-xl:   22px;
    --shadow:      0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:   0 8px 40px rgba(0,0,0,0.5);
    --transition:  0.18s ease;
}

/* ── TEMA CLARO ─────────────────────────────── */
html[data-theme="light"] {
    --bg:          #eef2fc;
    --bg2:         #ffffff;
    --bg3:         #f5f7ff;
    --bg4:         #e8edf8;
    --border:      #dde3f5;
    --border2:     #c5cfe8;
    --text:        #080f28;
    --text2:       #2d3a5e;
    --text3:       #6b7aaa;

    --red:         #dc2626;
    --red-dim:     #fef2f2;
    --yellow:      #d97706;
    --yellow-dim:  #fffbeb;
    --green:       #16a34a;
    --green-dim:   #f0fdf4;
    --blue:        #2563eb;
    --blue-dim:    #eff6ff;

    --accent:      #2563eb;
    --accent-hover:#1d4ed8;
    --accent-glow: rgba(37,99,235,0.1);
    --accent-glow2:rgba(37,99,235,0.2);

    --shadow:      0 2px 16px rgba(15,23,51,0.07), 0 1px 3px rgba(15,23,51,0.05);
    --shadow-lg:   0 8px 40px rgba(15,23,51,0.12);
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.2s ease;
}

/* Fondo suave en modo claro */
html[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 15% 40%, rgba(37,99,235,0.07) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(99,102,241,0.05) 0%, transparent 35%),
        radial-gradient(circle at 50% 95%, rgba(37,99,235,0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── LAYOUT ─────────────────────────────────── */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}
.container--wide { max-width: 960px; }
.page { min-height: 100vh; padding: 24px 0 48px; }

/* ── HEADER ─────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 0 28px;
}
.logo {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 3px;
}
.logo span { color: var(--accent); }
.header__sub {
    font-size: 12px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* ── TOGGLE TEMA ────────────────────────────── */
.theme-toggle {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.theme-toggle .t-dark  { display: inline; }
.theme-toggle .t-light { display: none; }
html[data-theme="light"] .theme-toggle .t-dark  { display: none; }
html[data-theme="light"] .theme-toggle .t-light { display: inline; }

/* ── CARD ───────────────────────────────────── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
html[data-theme="light"] .card { box-shadow: var(--shadow); }
.card--accent { border-color: var(--accent); background: var(--blue-dim); }

/* ── ZONA BADGE ─────────────────────────────── */
.zona-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text2);
    margin-bottom: 20px;
}
.zona-badge::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── FORMULARIO ─────────────────────────────── */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text2);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 13px 16px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text3); }
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg2);
}
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    background-color: #ffffff;
    background-image: none;
}
html[data-theme="light"] select {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a5580' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}
select option { background: var(--bg3); color: var(--text); }

/* ── LOGIN ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-box { width: 100%; max-width: 420px; }

.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo {
    font-family: var(--font-mono);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}
.login-logo span { color: var(--accent); }
.login-subtitle { font-size: 14px; color: var(--text3); }

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
html[data-theme="light"] .login-card {
    box-shadow: 0 8px 40px rgba(15,23,51,0.1);
}
.login-card .form-group { margin-bottom: 18px; }
.login-card label {
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    color: var(--text2);
}
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text3);
}

/* ── UPLOAD DE FOTO ─────────────────────────── */
.upload-area {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.upload-area input[type="file"] { display: none; }
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text2); }
.upload-preview { display: none; margin-top: 12px; }
.upload-preview img {
    border-radius: var(--radius);
    max-height: 180px;
    margin: 0 auto;
    object-fit: cover;
}

/* ── BOTONES ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn--primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
    font-size: 15px;
    padding: 15px;
    letter-spacing: 0.2px;
}
.btn--primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow2);
    color: #fff;
}
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
    background: var(--bg3);
    color: var(--text);
    border: 1.5px solid var(--border2);
}
.btn--secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.btn--danger { background: var(--red); color: #fff; }
.btn--success { background: var(--green); color: #fff; }
.btn--ghost {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border);
    font-size: 13px;
    padding: 8px 16px;
}
.btn--ghost:hover {
    color: var(--text);
    border-color: var(--border2);
    text-decoration: none;
}
.btn--loading { opacity: 0.7; pointer-events: none; }
.btn--loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ESTADOS ────────────────────────────────── */
.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.estado-badge--pendiente            { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red); }
.estado-badge--en_proceso           { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow); }
.estado-badge--esperando_aprobacion { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue); }
.estado-badge--solucionado          { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green); }

html[data-theme="light"] .estado-badge--pendiente            { color: var(--red); }
html[data-theme="light"] .estado-badge--en_proceso           { color: #92400e; border-color: #d97706; background: #fffbeb; }
html[data-theme="light"] .estado-badge--esperando_aprobacion { color: #1e40af; }
html[data-theme="light"] .estado-badge--solucionado          { color: #166534; }

/* ── TICKET ID ──────────────────────────────── */
.ticket-id {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    text-align: center;
    padding: 20px;
    background: var(--blue-dim);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    margin: 20px 0;
}

/* ── TIMELINE ───────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px; top: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-evento { font-size: 14px; font-weight: 600; color: var(--text); }
.timeline-fecha  { font-size: 12px; color: var(--text3); font-family: var(--font-mono); margin-top: 2px; }
.timeline-detalle{ font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ── ESTRELLAS ──────────────────────────────── */
.stars { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.star {
    font-size: 36px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity var(--transition), transform var(--transition);
    user-select: none;
}
.star:hover, .star.active { opacity: 1; transform: scale(1.15); }

/* ── ALERTAS ────────────────────────────────── */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.alert--warning { background: var(--yellow-dim); border: 1px solid var(--yellow); color: var(--yellow); }
.alert--success { background: var(--green-dim);  border: 1px solid var(--green);  color: var(--green); }
.alert--error   { background: var(--red-dim);    border: 1px solid var(--red);    color: var(--red); }
.alert--info    { background: var(--blue-dim);   border: 1px solid var(--blue);   color: var(--blue); }

html[data-theme="light"] .alert--warning { color: #92400e; }
html[data-theme="light"] .alert--success { color: #166534; }
html[data-theme="light"] .alert--error   { color: #991b1b; }
html[data-theme="light"] .alert--info    { color: #1e40af; }

/* ── HELPERS ────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-mono   { font-family: var(--font-mono); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.optional-tag {
    font-size: 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text3);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    font-weight: 400;
    vertical-align: middle;
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 400px) {
    .card { padding: 18px; }
    .ticket-id { font-size: 26px; }
    .login-card { padding: 24px 18px; }
}