/* -------------------------------------------------------
   CIRS Unified Stylesheet (CSS.css)
   Applies to: ptinfo.php, randomize.php, decrypt*.php
   ------------------------------------------------------- */

:root {
    --brand: #0c2074;
    --brand-hover: #09185c;
    --error: #b00020;
    --error-bg: #fde8ec;
    --muted: #6b7280;
    --bg: #f8fafc;
    --card-border: #cbd5e1;
    --card-shadow: rgba(0,0,0,0.06);
    --input-border: #cbd5e1;
    --input-focus: #0c2074;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: #111;
    margin: 0;
}

/* Layout containers */

header, main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
}

.brand-hr {
    border: 0;
    height: 3px;
    background: var(--brand);
    margin: 12px 0 20px;
}

.card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--card-shadow);
    margin-top: 20px;
}

/* Typography */

h1, h2, h3, h4, h5 {
    margin: 0.6em 0;
}

.muted {
    color: var(--muted);
}

/* Inputs */

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    max-width: 320px;
    padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

textarea {
    width: 100%;
    min-height: 180px;
    max-width: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 2px rgba(12,32,116,0.15);
}

/* Buttons */

.button {
    background: var(--brand);
    color: #fff;
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.button:hover {
    background: var(--brand-hover);
}

.button-secondary {
    background: var(--muted);
    color: #fff;
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.button-secondary:hover {
    background: #4b5563;
}

/* Error messages */

.error, .err {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Table formatting */

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 6px 8px;
    vertical-align: top;
}

td:first-child {
    color: #374151;
    width: 260px;
}

/* Preformatted blocks */

pre {
    background: #f6f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsiveness */

@media (max-width: 720px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        max-width: 100%;
    }

    td:first-child {
        width: auto;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}