/*
 * style.css
 * MNventus Academy — Sistema de Validación de Certificados
 * Diseño: minimalista, institucional, sin fuentes externas
 */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f5f7fb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 24px;
    text-align: center;
}

.header-logo-link {
    display: inline-block;
    line-height: 0;
}

.header-logo {
    height: 48px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* ── Main ────────────────────────────────────────────────────────── */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

/* ── Card ────────────────────────────────────────────────────────── */
.card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 40px 40px 36px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.card__title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card__desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Formulario ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 14px;
}

.form-input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    letter-spacing: 0.03em;
}

.form-input::placeholder {
    color: #9ca3af;
    letter-spacing: 0;
}

.form-input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-input.is-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.form-error {
    margin-top: 6px;
    font-size: 0.84rem;
    color: #dc2626;
    min-height: 18px;
}

/* ── Botones ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn--primary {
    background-color: #2563eb;
    color: #ffffff;
    width: 100%;
    padding: 11px 20px;
    font-size: 0.9375rem;
}

.btn--primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.btn--primary:active {
    background-color: #1e40af;
}

.btn--secondary {
    background-color: transparent;
    color: #2563eb;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
}

.btn--secondary:hover {
    background-color: #f5f7fb;
    border-color: #2563eb;
}

/* ── Resultado ───────────────────────────────────────────────────── */
.result {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

/* Icono circular de resultado */
.result__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.result__icon svg {
    width: 34px;
    height: 34px;
}

.icon--valid {
    background-color: #dcfce7;
    color: #16a34a;
    border: 2px solid #bbf7d0;
}

.icon--error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

.icon--neutral {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

/* Títulos de resultado */
.result__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

.result__title--valid {
    color: #166534;
}

.result__msg {
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 400px;
    line-height: 1.55;
}

/* ── Tabla de datos del certificado ─────────────────────────────── */
.cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.cert-table th,
.cert-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.cert-table tr:last-child th,
.cert-table tr:last-child td {
    border-bottom: none;
}

.cert-table th {
    width: 42%;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.84rem;
    background-color: #f9fafb;
    white-space: nowrap;
}

.cert-table td {
    color: #111827;
    font-weight: 400;
}

/* ── Código monospace ────────────────────────────────────────────── */
.mono {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    letter-spacing: 0.04em;
    color: #1d4ed8;
}

/* ── Badge de estado ─────────────────────────────────────────────── */
.estado {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.estado--valido {
    background-color: #dcfce7;
    color: #166534;
}

.estado--revocado {
    background-color: #fee2e2;
    color: #991b1b;
}

.estado--expirado {
    background-color: #fef3c7;
    color: #92400e;
}

/* ── Acciones resultado ──────────────────────────────────────────── */
.result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
}

/* ── Separador visual entre secciones de la tarjeta ─────────────── */
.result + .result__actions {
    margin-top: 8px;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 18px 24px;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 580px) {
    .card {
        padding: 28px 20px 24px;
        border-radius: 8px;
    }

    .card__title {
        font-size: 1.2rem;
    }

    .cert-table th {
        width: 38%;
    }

    .result__actions {
        flex-direction: column;
    }

    .result__actions .btn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .main {
        padding: 24px 12px;
        align-items: flex-start;
    }

    .cert-table th,
    .cert-table td {
        padding: 9px 12px;
        font-size: 0.84rem;
    }
}

/* ── Accesibilidad ───────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; }
}