/* DevFix — JWT Debugger (layout: entrada | resultado estilo workbench) */

.jwt-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.jwt-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 24px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg-surface) 100%);
}

.jwt-head-copy {
    min-width: 0;
}

.jwt-head h2 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2vw, 1.75rem);
    letter-spacing: -0.02em;
}

.jwt-head p {
    margin: 0;
    max-width: 52rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.94rem;
}

/* —— Workbench: duas colunas —— */
.jwt-workbench {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr);
    gap: 0;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}

.jwt-col {
    min-width: 0;
    padding: 20px 24px;
}

.jwt-col-in {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
}

.jwt-col-out {
    background: var(--bg-raised);
    display: flex;
}

.jwt-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.jwt-col-in .jwt-card {
    background: var(--bg-raised);
}

.jwt-card-head {
    margin-bottom: 14px;
}

.jwt-card-head--inline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.jwt-card-head--inline .jwt-card-desc {
    margin-top: 6px;
}

.jwt-card-kicker {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.jwt-card-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 800;
}

.jwt-card-desc {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.jwt-card-desc code {
    font-size: 0.8em;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--accent);
}

.jwt-out-heading {
    margin-bottom: 14px;
}

.jwt-out-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 800;
}

.jwt-out-desc {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.jwt-panel-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-height: 420px;
    padding: 0;
    background: transparent;
    border: none;
}

.jwt-label {
    display: grid;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 800;
}

.jwt-label-output {
    margin-top: 4px;
}

.jwt-input,
.jwt-textarea {
    width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 11px 12px;
    outline: none;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.jwt-input:focus,
.jwt-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.jwt-textarea {
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.55;
}

.jwt-token-input {
    min-height: 160px;
}

.jwt-key-input {
    min-height: 100px;
}

.jwt-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.jwt-action-row--split {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.jwt-action-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.jwt-action-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.jwt-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.jwt-shell .btn-primary {
    min-width: 140px;
    padding: 0 22px;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}

.jwt-shell .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-md);
}

.jwt-shell .btn-secondary {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.jwt-shell .btn-secondary:hover {
    background: var(--bg-surface);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.jwt-shell .btn-ghost {
    min-width: unset;
    padding: 0 14px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
}

.jwt-shell .btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-raised);
}

.jwt-shell .btn:hover {
    transform: translateY(-1px);
}

.jwt-mini-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 5px 10px;
    color: var(--text-muted);
    background: var(--bg-surface);
    font-size: 0.72rem;
    font-weight: 800;
}

.jwt-mini-ok {
    color: var(--accent);
    border-color: var(--accent-glow);
    background: var(--accent-soft);
}

.jwt-mini-bad {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.08);
}

.jwt-status-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-surface);
}

.jwt-status-card strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.jwt-status-card span {
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 0.86rem;
}

.jwt-status-ok {
    border-color: var(--accent-glow);
    background: var(--accent-soft);
}

.jwt-status-warn {
    border-color: rgba(217, 119, 6, 0.34);
    background: rgba(217, 119, 6, 0.08);
}

.jwt-status-bad {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(239, 68, 68, 0.08);
}

.jwt-result-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jwt-mini-tab {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.8rem;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.jwt-mini-tab:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.jwt-mini-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.jwt-output-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    margin-top: 2px;
}

.jwt-view {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.jwt-view.active {
    display: flex;
}

.jwt-table-wrap {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: auto;
    min-height: 220px;
}

.jwt-table {
    width: 100%;
    border-collapse: collapse;
}

.jwt-table th,
.jwt-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.jwt-table th {
    width: 150px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.jwt-table td code {
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

.jwt-table td small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.jwt-json-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    flex: 1;
    min-height: 220px;
}

.jwt-json-block {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.jwt-json-heading {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.jwt-code {
    flex: 1;
    margin: 0;
    min-height: 180px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: auto;
}

.jwt-signature-info {
    flex: 1;
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: auto;
    min-height: 220px;
    font-size: 0.86rem;
}

.jwt-signature-placeholder {
    margin: 0;
    color: var(--text-muted);
    align-self: center;
    text-align: center;
    padding: 2rem 1rem;
    line-height: 1.5;
}

.jwt-sign-row {
    display: grid;
    gap: 4px;
}

.jwt-sign-row strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.jwt-sign-row code {
    overflow-wrap: anywhere;
    color: var(--accent);
    font-size: 0.8rem;
}

.jwt-sign-validate-slot {
    margin-top: 4px;
}

.jwt-sign-result {
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-weight: 800;
    font-size: 0.86rem;
}

.jwt-sign-ok {
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-glow);
}

.jwt-sign-bad {
    color: var(--error);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

/* —— Gerador —— */
.jwt-generator {
    padding: 0;
    background: var(--bg-surface);
}

.jwt-generator-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.jwt-generator-divider::before,
.jwt-generator-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.85;
}

.jwt-generator-inner {
    padding: 20px 24px 24px;
}

.jwt-generator-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 4px;
}

.jwt-generator-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.jwt-generator-head p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.9rem;
    max-width: 48rem;
}

.jwt-generator-grid {
    display: grid;
    grid-template-columns: 160px 140px minmax(0, 1fr);
    grid-template-areas:
        'alg exp secret'
        'payload payload payload';
    gap: 14px 16px;
    margin-top: 18px;
}

.jwt-generator-grid > .jwt-label:nth-child(1) {
    grid-area: alg;
}

.jwt-generator-grid > .jwt-label:nth-child(2) {
    grid-area: exp;
}

.jwt-field-secret {
    grid-area: secret;
}

.jwt-field-payload {
    grid-area: payload;
}

.jwt-gen-payload {
    min-height: 120px;
}

.jwt-generated-output {
    margin-top: 8px;
    min-height: 72px;
    font-size: 0.78rem;
}

@media (max-width: 1100px) {
    .jwt-workbench {
        grid-template-columns: 1fr;
    }

    .jwt-col-in {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .jwt-panel-output {
        min-height: 360px;
    }

    .jwt-json-grid {
        grid-template-columns: 1fr;
    }

    .jwt-generator-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            'alg exp'
            'secret secret'
            'payload payload';
    }
}

@media (max-width: 680px) {
    .jwt-head {
        flex-direction: column;
        padding: 18px;
    }

    .jwt-col {
        padding: 16px;
    }

    .jwt-generator-inner {
        padding: 16px;
    }

    .jwt-card-head--inline {
        flex-direction: column;
    }

    .jwt-action-row--split {
        flex-direction: column;
        align-items: stretch;
    }

    .jwt-action-secondary {
        margin-left: 0;
        width: 100%;
    }

    .jwt-action-secondary .btn {
        flex: 1;
        justify-content: center;
    }

    .jwt-shell .btn-primary {
        width: 100%;
    }

    .jwt-generator-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            'alg'
            'exp'
            'secret'
            'payload';
    }
}
