/* ===== Sistema de Soporte STK - Diseño moderno ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Paleta principal */
    --bg-deep: #0c1222;
    --bg-mid: #111827;
    --bg-card: #1a2332;
    --bg-elevated: #ffffff;
    --gradient-start: #1e3a5f;
    --gradient-end: #0f172a;
    --accent: #0ea5e9;
    --accent-hover: #38bdf8;
    --accent-muted: rgba(14, 165, 233, 0.2);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.35);
    /* Texto */
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #f8fafc;
    --text-inverse-muted: rgba(248, 250, 252, 0.7);
    /* Estados */
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --border: #e2e8f0;
    --border-dark: rgba(255, 255, 255, 0.08);
    /* Sistema de diseño */
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
    --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.15);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.25s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.6;
}

/* ===== Header / Brand (todas las páginas) ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(12, 18, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dark);
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    transition: opacity var(--duration) var(--ease);
}

.site-header .brand:hover {
    opacity: 0.9;
}

.site-header .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.site-header .brand-logo {
    height: 40px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.site-header .back-link {
    margin-bottom: 0;
    font-size: 0.9rem;
}

body.pagina-inicio .site-header .back-link {
    opacity: 0.6;
    pointer-events: none;
    visibility: hidden;
}

/* ===== Página de inicio ===== */
body.pagina-inicio {
    background: linear-gradient(160deg, var(--gradient-start) 0%, var(--bg-deep) 50%, var(--gradient-end) 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 48px;
    color: var(--text-inverse);
    position: relative;
}

body.pagina-inicio::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(14, 165, 233, 0.18), transparent 50%),
        radial-gradient(ellipse 60% 50% at 100% 50%, rgba(30, 58, 95, 0.4), transparent 50%),
        radial-gradient(ellipse 50% 40% at 0% 80%, rgba(59, 130, 246, 0.08), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.pagina-inicio .container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
}

.pagina-inicio .page-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pagina-inicio .page-subtitle {
    text-align: center;
    color: var(--text-inverse-muted);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 48px;
}

/* Opciones principales */
.options-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 56px;
}

@media (max-width: 600px) {
    .options-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.option-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 40px 28px;
    text-decoration: none;
    color: var(--text-inverse);
    transition: all 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(14, 165, 233, 0.35);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-card-hover), var(--shadow-glow);
}

.option-card:hover::before {
    opacity: 1;
}

.option-card .icon {
    font-size: 52px;
    margin-bottom: 20px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.option-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.option-card p {
    font-size: 0.9rem;
    color: var(--text-inverse-muted);
    line-height: 1.5;
}

.footer-admin {
    margin-top: auto;
    padding-top: 24px;
    text-align: center;
    animation: fadeIn 0.6s ease 0.3s both;
}

.footer-admin a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

.footer-admin a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Páginas formulario / interior ===== */
body.pagina-form {
    background: linear-gradient(160deg, var(--gradient-start) 0%, var(--bg-deep) 50%, var(--gradient-end) 100%);
    background-attachment: fixed;
    padding: 88px 24px 24px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Página de solicitud: permitir scroll y contenido fluido */
body.form-solicitud {
    padding-top: 72px;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    min-height: 100vh;
}

body.form-solicitud .container {
    max-width: 720px;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    padding: 0 20px;
}

body.form-solicitud .container-card--form {
    padding: 28px 32px;
    overflow: visible;
    width: 100%;
    max-width: 100%;
}

body.form-solicitud #formSolicitud {
    min-width: 0;
}

body.form-solicitud .container-card--form h1 {
    margin-bottom: 20px;
    font-size: 1.4rem;
}

body.form-solicitud .form-section {
    margin-bottom: 20px;
}

body.form-solicitud .form-section-title {
    margin-bottom: 10px;
    padding-bottom: 4px;
    font-size: 0.75rem;
}

body.form-solicitud .form-group {
    margin-bottom: 14px;
}

body.form-solicitud input,
body.form-solicitud select,
body.form-solicitud textarea {
    padding: 10px 14px;
    font-size: 0.95rem;
    max-width: 100%;
}

body.form-solicitud textarea {
    min-height: 72px;
}

body.form-solicitud .help-text {
    margin-top: 4px;
    font-size: 0.75rem;
}

body.form-solicitud .btn-primary {
    margin-top: 4px;
    padding: 12px 24px;
    min-width: 160px;
}

/* Grid de 2 columnas en formularios */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-row-2 .form-group {
    margin-bottom: 14px;
}

@media (max-width: 640px) {
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body.form-solicitud .container {
        padding: 0 16px;
    }

    body.form-solicitud .container-card--form {
        padding: 24px 20px;
    }

    body.form-solicitud {
        padding: 72px 0 24px;
    }
}

@media (max-width: 480px) {
    body.form-solicitud .container {
        padding: 0 12px;
    }

    body.form-solicitud .container-card--form {
        padding: 20px 16px;
    }

    body.form-solicitud .container-card--form h1 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    body.form-solicitud .form-section {
        margin-bottom: 16px;
    }

    body.form-solicitud input,
    body.form-solicitud select,
    body.form-solicitud textarea {
        padding: 12px 14px;
        font-size: 16px;
    }

    body.form-solicitud textarea {
        min-height: 80px;
    }

    body.form-solicitud .btn-primary {
        width: 100%;
        min-width: 0;
        padding: 14px 20px;
    }
}

@media (max-width: 380px) {
    body.form-solicitud .container {
        padding: 0 10px;
    }

    body.form-solicitud .container-card--form {
        padding: 16px 12px;
    }
}

body.pagina-form::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(14, 165, 233, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 50% at 100% 50%, rgba(30, 58, 95, 0.35), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.pagina-form .container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

body.form-solicitud .container {
    max-width: 720px;
}

/* Tarjeta de contenido */
body.pagina-form .container-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    padding: 44px 40px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

body.pagina-form .container-card.container-card--form {
    overflow: visible;
}

body.pagina-form .container-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    opacity: 1;
}

body.pagina-form .container-card.container-card--wide {
    max-width: 700px;
    padding: 44px 40px;
}

@media (max-width: 640px) {
    body.pagina-form .container-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }
}

body.pagina-form .back-link {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
    font-weight: 500;
}

body.pagina-form .back-link:hover {
    color: #fff;
}

/* ===== Animaciones ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-in {
    animation: fadeInUp 0.5s var(--ease) forwards;
}

/* ===== Títulos en tarjeta ===== */
.container-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    letter-spacing: -0.03em;
    line-height: 1.3;
}

/* ===== Formularios ===== */
.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group label.required::after {
    content: ' *';
    color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    background: #fff;
    color: var(--text-primary);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #cbd5e1;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="file"] {
    padding: 14px;
    font-size: 0.9rem;
    border: 2px dashed var(--border);
    background: #f8fafc;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}

input[type="file"]:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.captcha-label {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.captcha-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.captcha-group input[type="number"] {
    max-width: 120px;
}

/* ===== Botones ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.btn.is-loading {
    pointer-events: none;
    position: relative;
}

.btn.is-loading .btn-text {
    visibility: hidden;
}

.btn .spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

.btn.is-loading .spinner {
    display: block;
}

/* ===== Alertas ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: fadeIn 0.35s var(--ease);
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: var(--error-bg);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== Detalle solicitud ===== */
.estado-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 28px;
    animation: fadeIn 0.4s var(--ease);
    letter-spacing: 0.02em;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 20px;
    animation: fadeInUp 0.4s var(--ease) backwards;
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-row:nth-child(1) { animation-delay: 0.05s; }
.detail-row:nth-child(2) { animation-delay: 0.08s; }
.detail-row:nth-child(3) { animation-delay: 0.11s; }
.detail-row:nth-child(4) { animation-delay: 0.14s; }
.detail-row:nth-child(5) { animation-delay: 0.17s; }
.detail-row:nth-child(6) { animation-delay: 0.2s; }
.detail-row:nth-child(7) { animation-delay: 0.23s; }

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.descripcion {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius);
    margin: 24px 0;
    white-space: pre-wrap;
    line-height: 1.65;
    border-left: 4px solid var(--accent);
    animation: fadeIn 0.4s var(--ease);
    font-size: 0.95rem;
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

.adjuntos {
    margin-top: 8px;
    animation: fadeIn 0.4s var(--ease);
}

.adjuntos ul {
    list-style: none;
}

.adjuntos li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.adjuntos li:last-child {
    border-bottom: none;
}

.adjunto-link {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.adjunto-link:hover {
    text-decoration: underline;
}

.comentarios-list {
    margin-top: 8px;
}

.comentario-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.comentario-item:last-child {
    border-bottom: none;
}

.comentario-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.comentario-tipo {
    font-weight: 600;
    color: var(--primary);
}

.comentario-usuario {
    font-weight: 500;
    color: var(--text-primary);
}

.comentario-texto {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.comentario-estado {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fecha {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.back-link + .back-link {
    margin-left: 12px;
}

/* ===== Modal éxito (solicitud creada) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-overlay.modal-abierto {
    display: flex;
    animation: fadeIn 0.25s var(--ease);
}

.modal-box {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-card-hover);
    border: 1px solid var(--border);
    animation: fadeInUp 0.3s var(--ease);
}

.modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--success-bg);
    color: #047857;
    font-size: 28px;
    font-weight: 700;
    line-height: 56px;
    border-radius: 50%;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.modal-mensaje {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 24px 0;
}

.modal-box .btn-primary {
    min-width: 200px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
