/* =========================================================================
   Polígono Thor — Certificados v3.0.0
   style.css — Portal público [thor_certificados]
   Diseño oscuro táctico coherente con poligonothor.com
   ========================================================================= */

:root {
    --thor-red:      #E53935;
    --thor-red-dark: #B71C1C;
    --thor-red-glow: rgba(229,57,53,0.22);
    --thor-bg:       #0D0D0D;
    --thor-surface:  #161616;
    --thor-surface2: #1E1E1E;
    --thor-border:   #2A2A2A;
    --thor-border2:  #333333;
    --thor-text:     #F0F0F0;
    --thor-text2:    #AAAAAA;
    --thor-text3:    #555555;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
#thor-cert-wrap *, #thor-cert-wrap *::before, #thor-cert-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Contenedor ───────────────────────────────────────────────────────────── */
#thor-cert-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
    color: var(--thor-text);
}

/* Línea roja decorativa superior */
#thor-cert-wrap::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--thor-red);
    margin-bottom: 1.4rem;
}

/* ── Badge ────────────────────────────────────────────────────────────────── */
.thor-badge {
    display: inline-block;
    background: transparent;
    color: var(--thor-red);
    border: 1px solid rgba(229,57,53,0.45);
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    margin-bottom: 1rem;
}

/* ── Título ───────────────────────────────────────────────────────────────── */
.thor-heading {
    font-size: 2rem;
    font-weight: 900;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.thor-heading span {
    color: var(--thor-red);
}

/* ── Subtítulo ────────────────────────────────────────────────────────────── */
.thor-sub {
    font-size: 0.88rem;
    color: var(--thor-text2);
    margin-bottom: 2rem;
    line-height: 1.7;
    border-left: 2px solid var(--thor-red);
    padding-left: 12px;
}

/* ── Tarjeta formulario ───────────────────────────────────────────────────── */
.thor-card {
    background: var(--thor-surface);
    border: 1px solid var(--thor-border2);
    border-top: 2px solid var(--thor-red);
    border-radius: 3px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.thor-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 28px;
    height: 28px;
    border-bottom: 2px solid var(--thor-red);
    border-right: 2px solid var(--thor-red);
}

/* ── Label ────────────────────────────────────────────────────────────────── */
.thor-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--thor-text3);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 0.55rem;
}

/* ── Input group ──────────────────────────────────────────────────────────── */
.thor-input-group {
    display: flex;
    margin-bottom: 1.2rem;
    border: 1px solid var(--thor-border2);
    border-radius: 2px;
    overflow: hidden;
    background: var(--thor-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.thor-input-group:focus-within {
    border-color: var(--thor-red);
    box-shadow: 0 0 0 3px var(--thor-red-glow);
}

.thor-tipdoc {
    border: none;
    border-right: 1px solid var(--thor-border2);
    background: var(--thor-surface2);
    padding: 13px 10px 13px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--thor-text);
    cursor: pointer;
    outline: none;
    min-width: 72px;
    letter-spacing: 0.04em;
}

.thor-tipdoc option {
    background: var(--thor-surface2);
    color: var(--thor-text);
}

.thor-cedula {
    border: none;
    background: transparent;
    padding: 13px 16px;
    font-size: 1rem;
    color: var(--thor-text);
    outline: none;
    flex: 1;
    min-width: 0;
    letter-spacing: 0.04em;
}

.thor-cedula::placeholder {
    color: var(--thor-text3);
    font-size: 0.88rem;
}

/* ── Shake ────────────────────────────────────────────────────────────────── */
@keyframes thor-shake {
    0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)}
    40%{transform:translateX(6px)}   60%{transform:translateX(-4px)}
    80%{transform:translateX(4px)}
}
.thor-shake {
    animation: thor-shake 0.45s ease;
    border-color: var(--thor-red) !important;
    box-shadow: 0 0 0 3px var(--thor-red-glow) !important;
}

/* ── Botón principal ──────────────────────────────────────────────────────── */
.thor-btn {
    width: 100%;
    background: var(--thor-red);
    color: #fff;
    border: none;
    border-radius: 2px;
    padding: 14px 20px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

/* Efecto barrido de luz */
.thor-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent);
    transition: left 0.55s;
}
.thor-btn:hover:not(:disabled)::after { left: 160%; }

.thor-btn:hover:not(:disabled) {
    background: var(--thor-red-dark);
    box-shadow: 0 0 24px var(--thor-red-glow), 0 4px 12px rgba(0,0,0,0.4);
}
.thor-btn:active:not(:disabled) { transform: scale(0.985); }
.thor-btn:disabled { background: #2a1010; color: #5a3030; cursor: not-allowed; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.thor-spinner {
    display: none;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: thor-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes thor-spin { to { transform: rotate(360deg); } }

/* ── Resultado ────────────────────────────────────────────────────────────── */
.thor-result-card {
    background: var(--thor-surface);
    border: 1px solid var(--thor-border2);
    border-top: 2px solid var(--thor-red);
    border-radius: 3px;
    overflow: hidden;
    animation: thor-fadein 0.35s ease;
}

@keyframes thor-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Error */
.thor-result-card.thor-error {
    border-top-color: #7f1010;
    background: rgba(127,16,16,0.1);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.thor-result-card.thor-error .thor-r-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Header resultado */
.thor-r-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.3rem 1.5rem;
    background: var(--thor-surface2);
    border-bottom: 1px solid var(--thor-border);
}

.thor-r-icon {
    width: 42px; height: 42px;
    background: rgba(229,57,53,0.1);
    border: 1px solid rgba(229,57,53,0.3);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.thor-r-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.thor-r-sub {
    font-size: 0.75rem;
    color: var(--thor-text3);
    margin-top: 3px;
    letter-spacing: 0.08em;
    font-family: 'Courier New', monospace;
}

/* Grid campos resultado */
.thor-r-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.thor-r-field {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--thor-border);
}
.thor-r-field:nth-child(odd) { border-right: 1px solid var(--thor-border); }

.thor-r-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--thor-text3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 5px;
}

.thor-r-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--thor-text);
    word-break: break-word;
}

/* Badges estado */
.thor-badge-st {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 2px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.thor-st-ok {
    background: rgba(46,125,50,0.15);
    color: #81C784;
    border: 1px solid rgba(129,199,132,0.3);
}

.thor-st-no {
    background: rgba(183,28,28,0.15);
    color: #EF9A9A;
    border: 1px solid rgba(239,154,154,0.25);
}

/* Botón descargar PDF */
.thor-btn-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--thor-red);
    color: #fff;
    border: none;
    padding: 16px 20px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.thor-btn-pdf::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent);
    transition: left 0.55s;
}
.thor-btn-pdf:hover::after { left: 160%; }
.thor-btn-pdf:hover {
    background: var(--thor-red-dark);
    box-shadow: 0 0 24px var(--thor-red-glow);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .thor-heading { font-size: 1.5rem; }
    .thor-r-grid { grid-template-columns: 1fr; }
    .thor-r-field:nth-child(odd) { border-right: none; }
    .thor-card { padding: 1.3rem; }
    .thor-r-header { padding: 1rem 1.2rem; }
    .thor-r-field { padding: 0.8rem 1.2rem; }
}