/*
 * style.css — Project-S site-wide stylesheet
 * Loaded by every page via template.php render_header().
 * Page-specific styles are kept in <style> blocks within each page file.
 */

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

:root {
    --black:       #0a0a0a;
    --dark:        #111111;
    --panel:       #1a1a1a;
    --panel-light: #222222;
    --border:      #3a3a3a;
    --grey-mid:    #777777;
    --grey-light:  #aaaaaa;
    --red-dark:    #6b0e0e;
    --red:         #aa1111;
    --red-bright:  #dd2222;
    --red-glow:    #ff3333;
    --gold:        #a07840;
    --white:       #e8e8e8;

    --font-display: 'Cinzel Decorative', serif;
    --font-heading: 'Cinzel', serif;
    --font-body:    'IM Fell English', serif;
}

html, body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--red-bright);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--red-glow); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── Site wrapper ────────────────────────────────────────────────────────── */
#site-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Banner ──────────────────────────────────────────────────────────────── */
#site-banner {
    display: block;
    width: 100%;
    line-height: 0;
    border-bottom: 3px solid var(--red-dark);
    position: relative;
}
#site-banner::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--red) 20%,
        var(--red-bright) 50%,
        var(--red) 80%,
        transparent 100%);
    filter: blur(1px);
}
#site-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Navigation bar ──────────────────────────────────────────────────────── */
#site-nav {
    background: linear-gradient(180deg, #1c1c1c 0%, #0f0f0f 100%);
    border-bottom: 2px solid var(--red-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 2px 8px rgba(170,17,17,0.3);
}

#site-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

#site-nav ul li { position: relative; }

#site-nav ul li a {
    display: block;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grey-light);
    transition: color 0.2s, background 0.2s;
}

/* Vertical dividers between items */
#site-nav ul li + li::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 1px;
    background: var(--border);
}

#site-nav ul li a:hover,
#site-nav ul li a.active {
    color: var(--red-bright);
    background: rgba(170,17,17,0.08);
}

/* Red underline glow on hover/active */
#site-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 2px;
    background: var(--red-bright);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
#site-nav ul li a:hover::after,
#site-nav ul li a.active::after {
    transform: scaleX(1);
}

/* Sign Up / My Account — red CTA button */
#site-nav ul li.nav-cta a {
    color: var(--red-bright);
    border: 1px solid var(--red-dark);
    margin: 8px 16px;
    padding: 6px 20px;
    border-radius: 2px;
    background: rgba(107,14,14,0.15);
    letter-spacing: 0.15em;
}
#site-nav ul li.nav-cta a:hover {
    background: var(--red-dark);
    color: var(--white);
    border-color: var(--red);
    box-shadow: 0 0 12px rgba(170,17,17,0.5);
}
#site-nav ul li.nav-cta::before  { display: none; }
#site-nav ul li.nav-cta a::after { display: none; }

/* Sign Out — muted ghost button */
#site-nav ul li.nav-signout a {
    color: var(--grey-mid);
    border: 1px solid var(--border);
    margin: 8px 16px;
    padding: 6px 20px;
    border-radius: 2px;
    letter-spacing: 0.15em;
}
#site-nav ul li.nav-signout a:hover {
    color: var(--red-bright);
    border-color: var(--red-dark);
    background: rgba(107,14,14,0.12);
}
#site-nav ul li.nav-signout::before  { display: none; }
#site-nav ul li.nav-signout a::after { display: none; }

/* Sign In — ghost button, pairs with Sign Up */
#site-nav ul li.nav-signin a {
    color: var(--grey-light);
    border: 1px solid var(--border);
    margin: 8px 4px 8px 0;
    padding: 6px 20px;
    border-radius: 2px;
    letter-spacing: 0.15em;
}
#site-nav ul li.nav-signin a:hover {
    color: var(--white);
    border-color: var(--grey-mid);
    background: rgba(255,255,255,0.05);
}
#site-nav ul li.nav-signin a.active {
    color: var(--red-bright);
    border-color: var(--red-dark);
}
#site-nav ul li.nav-signin::before  { display: none; }
#site-nav ul li.nav-signin a::after { display: none; }

/* ── Page content slot ───────────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 40px 48px;
}

/* ── Shared UI components (usable on any page) ───────────────────────────── */

/* Decorative red rule */
hr.rule-red {
    border: none;
    border-top: 1px solid var(--red-dark);
    margin: 32px 0;
    position: relative;
}
hr.rule-red::after {
    content: '✦';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--dark);
    padding: 0 12px;
    color: var(--red-dark);
    font-size: 0.8rem;
}

/* Dark panel with red top border — used on forms, account sections, etc. */
.ps-panel {
    background: linear-gradient(160deg, #181818 0%, #111111 100%);
    border: 1px solid var(--border);
    border-top: 3px solid var(--red-dark);
    padding: 36px 40px;
    position: relative;
}
.ps-panel::before {
    content: '';
    position: absolute;
    top: -1px; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

/* Panel section heading */
.ps-panel h2,
.ps-section-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--red);
    border-bottom: 1px solid var(--red-dark);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* Form groups */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-light);
    margin-bottom: 6px;
}
.form-group label .req { color: var(--red-bright); margin-left: 2px; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(170,17,17,0.2);
}
.form-group input.input-error {
    border-color: var(--red-bright);
    box-shadow: 0 0 0 2px rgba(221,34,34,0.25);
}

.field-error {
    color: var(--red-bright);
    font-size: 0.8rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.field-error::before { content: '⚠'; font-size: 0.75rem; }

.field-hint {
    color: var(--grey-mid);
    font-size: 0.78rem;
    margin-top: 4px;
}

/* Notice / alert banners */
.notice {
    padding: 12px 16px;
    border-radius: 2px;
    font-size: 0.88rem;
    margin-bottom: 20px;
    border: 1px solid;
    line-height: 1.5;
}
.notice.success {
    background: rgba(20,80,20,0.2);
    border-color: #2a6a2a;
    color: #6abf6a;
}
.notice.error {
    background: rgba(170,17,17,0.15);
    border-color: var(--red);
    color: var(--red-bright);
}
.notice ul { margin: 6px 0 0 18px; }

/* Error banner (full-width, above forms) */
.error-banner {
    background: rgba(170,17,17,0.15);
    border: 1px solid var(--red);
    color: var(--red-bright);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    border-radius: 2px;
    line-height: 1.5;
}
.error-banner a { color: var(--red-bright); text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 11px 26px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn-primary {
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    border-color: var(--red);
    color: var(--white);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--red-bright) 0%, var(--red) 100%);
    box-shadow: 0 0 16px rgba(170,17,17,0.5);
    color: var(--white);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--grey-mid);
}
.btn-ghost:hover {
    border-color: var(--grey-mid);
    color: var(--white);
    background: rgba(255,255,255,0.04);
}
.btn-danger {
    background: transparent;
    border-color: #5a0a0a;
    color: #cc3333;
}
.btn-danger:hover {
    background: rgba(100,10,10,0.3);
    border-color: var(--red);
    color: var(--red-bright);
}
.btn-warn {
    background: rgba(100,80,0,0.15);
    border-color: #7a6010;
    color: #c8a030;
}
.btn-warn:hover {
    background: rgba(100,80,0,0.3);
    border-color: #c8a030;
}

/* Full-width submit button */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    border: 1px solid var(--red);
    border-radius: 2px;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 8px;
}
.btn-submit:hover {
    background: linear-gradient(180deg, var(--red-bright) 0%, var(--red) 100%);
    box-shadow: 0 0 18px rgba(170,17,17,0.5);
}

/* Checkbox groups */
.check-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(107,14,14,0.08);
    border: 1px solid var(--red-dark);
    border-radius: 2px;
}
.check-group.check-error {
    border-color: var(--red-bright);
    background: rgba(221,34,34,0.08);
}
.check-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: var(--red-bright);
    cursor: pointer;
}
.check-group label {
    font-size: 0.88rem;
    color: var(--grey-light);
    cursor: pointer;
    line-height: 1.5;
}
.check-group label strong { color: var(--white); }

/* 6-character code input (verify pages) */
.code-input-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 8px;
}
input.code-field {
    width: 210px;
    background: #0d0d0d;
    border: 2px solid var(--border);
    border-radius: 2px;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
    text-transform: uppercase;
    padding: 12px 8px 12px 20px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input.code-field:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(170,17,17,0.25);
}
input.code-field.input-error { border-color: var(--red-bright); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
#site-footer {
    background: var(--panel);
    border-top: 2px solid var(--red-dark);
    padding: 28px 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--grey-mid);
}

#site-footer .footer-name {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--red);
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(170,17,17,0.4);
}

#site-footer .footer-copy {
    text-align: center;
    flex: 1;
}

#site-footer .footer-links a {
    color: var(--grey-mid);
    font-family: var(--font-heading);
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}
#site-footer .footer-links a:hover { color: var(--red-bright); }

#site-footer .footer-link-sep {
    color: var(--border);
    margin: 0 8px;
    font-size: 0.75rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-content  { padding: 24px 20px; }
    #site-footer   { flex-direction: column; text-align: center; padding: 24px 20px; }
    #site-nav ul li a { padding: 12px 16px; font-size: 0.78rem; }
}