/* ==========================================================================
   Public Site — Card layout for all public pages (index, login, error)
   Design matches the certificate page (certificate.css) tokens.
   ========================================================================== */

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Page --- */
body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 16px;
    color: var(--cert-text);
    background: #f0ece6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2em 1em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Card --- */
.card {
    max-width: 580px;
    width: 100%;
    background: var(--cert-bg);
    border-radius: var(--cert-radius-card);
    padding: var(--cert-padding-y) var(--cert-padding-x) 44px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.04),
        0 4px 16px rgba(0,0,0,0.04),
        0 12px 40px rgba(0,0,0,0.06);
}

/* --- Card Header --- */
.card-header {
    text-align: center;
}

.card-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.75em;
    color: #1a1714;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.card-subtitle {
    font-family: 'Fraunces', serif;
    font-size: 1.05em;
    color: var(--cert-text-muted);
    font-style: italic;
    margin-top: 0.5em;
    line-height: 1.4;
}

/* --- Form Elements --- */
.search-form,
.login-form {
    text-align: left;
}

.search-input {
    display: block;
    width: 100%;
    padding: 14px 18px;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1em;
    line-height: 1.5;
    background: var(--cert-bg-subtle);
    border: 1px solid var(--cert-border);
    border-radius: var(--cert-radius-inner);
    color: var(--cert-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: #c4b9aa;
    box-shadow: 0 0 0 3px rgba(196, 185, 170, 0.2);
}

.search-input::placeholder {
    color: var(--cert-text-faint);
}

/* Hide number input spinners */
.search-input::-webkit-outer-spin-button,
.search-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.search-input[type=number] {
    -moz-appearance: textfield;
}

.search-button {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 13px 1em;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.78em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cert-bg);
    background: var(--cert-text);
    border: none;
    border-radius: var(--cert-radius-inner);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
}

.search-button:hover {
    background: #1a1714;
}

.search-button:active {
    transform: scale(0.985);
}

/* --- Login Form --- */
.login-form label {
    display: block;
    font-weight: 600;
    font-size: 0.88em;
    color: var(--cert-text-muted);
    margin-bottom: 0.35em;
    margin-top: 1em;
}

.login-form label:first-of-type {
    margin-top: 0;
}

.login-form .search-input {
    margin-bottom: 0;
}

/* --- Error Page --- */
.error-message {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--cert-text-muted);
    text-align: center;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5em;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--cert-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--cert-text);
}

/* --- Form Error --- */
.form-error {
    color: #a85454;
    font-size: 0.92em;
    text-align: center;
    margin-bottom: 0.5em;
}

/* --- Footer --- */
.page-footer {
    text-align: center;
    margin-top: 2.5em;
}

.page-footer small {
    font-size: 0.72em;
    font-weight: 500;
    color: #b0a798;
    letter-spacing: 0.04em;
}

/* --- Responsive: Tablet --- */
@media (max-width: 768px) {
    .card {
        box-shadow:
            0 1px 2px rgba(0,0,0,0.04),
            0 4px 16px rgba(0,0,0,0.06);
    }

    .card-title { font-size: 1.5em; }
}

/* --- Responsive: Mobile --- */
@media (max-width: 480px) {
    .card-title { font-size: 1.3em; }
    .card-subtitle { font-size: 0.95em; }
}
