* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f3f4f6; /* flat light background */
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff; /* flat white */
    border-radius: 8px;
    border: 1px solid #e6e6e6; /* subtle border instead of shadow */
    padding: 36px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #555;
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

a {
    color: #666;
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

.section {
    margin-top: 40px;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #444;
}

pre {
    background: #fafafa;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    border-left: 4px solid #d1d5db; /* lighter left border */
    margin-bottom: 20px;
}

code {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.highlight {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.info-box {
    background: #ffffff;
    border-left: 4px solid #e6e6e6;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* JWT generator specific styles */
.jwt-generator {
    padding: 12px;
}

.jwt-form {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px 20px;
    align-items: center;
    max-width: 760px;
}

.form-row {
    display: contents; /* label and input flow into grid columns */
}

.form-label {
    font-weight: 600;
    color: #3b3b3b;
    padding-right: 6px;
    font-size: 0.95rem;
}

.form-input {
    padding: 8px 10px;
    border: 1px solid #d2d6db;
    border-radius: 6px;
    background: #fff;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}

.btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cfcfcf;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: #111827; /* dark button to stand out */
    color: #fff;
    border-color: transparent;
}

.btn:active {
    transform: translateY(1px);
}

.muted {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 8px;
}

.token-output {
    margin-top: 12px;
    border-radius: 6px;
    background: #0f172a; /* dark background for token */
    color: #e6edf3;
    padding: 12px;
    overflow-x: auto;
}

.token-code {
    font-family: "Menlo", "Monaco", monospace;
    font-size: 0.85rem;
    white-space: pre-wrap; /* wrap long tokens for small screens */
    word-break: break-all;
}

/* Remove the default light pre background when inside the dark token output
   and ensure good contrast, spacing, and wrapping. */
.token-output pre {
    background: transparent; /* inherit dark background from container */
    border: none; /* remove left border from global pre */
    padding: 0; /* spacing handled by .token-output */
    margin: 0;
}

.token-output .token-code {
    color: #f8fafc; /* brighter for better contrast */
    opacity: 1; /* ensure fully opaque */
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word; /* prefer breaking at word boundaries */
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1rem;
    }

    pre {
        padding: 15px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }

    pre {
        padding: 12px;
    }
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.config-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.config-item .form-row {
    flex: 1;
    margin: 0;
}

.config-item .remove-item {
    padding: 0 10px;
    font-size: 1.2rem;
    line-height: 1;
    height: 38px;
}

@media (max-width: 600px) {
    .config-item {
        flex-direction: column;
        align-items: stretch;
    }

    .config-item .remove-item {
        align-self: flex-end;
    }
}
