/* ==========================================================================
   The City Wars public (logged-out) pages — Signup, Forgot Password,
   Contact Us, Terms of Service, Privacy Policy.
   Rendered by frontpage/new_footer.php when a page sets $cw_public_page.
   Every selector is scoped under .cwp so in-game pages are unaffected.
   ========================================================================== */

.cwp {
    --cwp-blue: #139cff;
    --cwp-blue-hi: #52b8ff;
    --cwp-blue-deep: #0a5fc4;
    --cwp-navy: #0a1424;
    --cwp-navy-2: #0e1c33;
    --cwp-field: #081122;
    --cwp-edge: rgba(19, 156, 255, .75);
    --cwp-text: #e6edf7;
    --cwp-muted: #9fb0c8;
    --cwp-red: #e0413a;
    --cwp-red-bg: rgba(165, 22, 22, .22);
    --cwp-green: #3fd07f;

    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--cwp-text);
    font: 14px/1.5 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #040c1a url("/images/the-city-wars-login-bg.png") center top / cover no-repeat fixed;
}

.cwp *, .cwp *::before, .cwp *::after { box-sizing: border-box; }

.cwp a { color: var(--cwp-blue-hi); }
.cwp a:hover { color: #fff; }
.cwp a:focus-visible,
.cwp input:focus-visible,
.cwp textarea:focus-visible,
.cwp button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* --- Hero spacer: lets the city skyline show above the content cards ----- */
.cwp-hero {
    position: relative;
    flex: none;
    height: 14vh;
    min-height: 60px;
}
.cwp-hero-link {
    position: absolute;
    left: 13%;
    top: 12%;
    width: 38%;
    height: 42%;
}
.cwp-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Main content column ------------------------------------------------ */
.cwp-main {
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
    padding: 0 24px 48px;
}

/* --- Distressed-metal panel --------------------------------------------- */
.cwp-card {
    position: relative;
    width: 100%;
    max-width: 940px;
    padding: 26px 44px 28px;
    border: 2px solid var(--cwp-edge);
    border-radius: 6px;
    background:
        /* paint splatters */
        radial-gradient(circle at 3% 10%, rgba(19,156,255,.30) 0 18px, transparent 19px),
        radial-gradient(circle at 5.5% 17%, rgba(19,156,255,.22) 0 7px, transparent 8px),
        radial-gradient(circle at 1.8% 20%, rgba(19,156,255,.25) 0 4px, transparent 5px),
        radial-gradient(circle at 97% 88%, rgba(19,156,255,.20) 0 22px, transparent 23px),
        radial-gradient(circle at 94.5% 94%, rgba(19,156,255,.18) 0 6px, transparent 7px),
        radial-gradient(ellipse at 50% 0%, rgba(19,156,255,.10), transparent 60%),
        /* brushed-metal grain */
        repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px),
        linear-gradient(180deg, rgba(14,28,51,.96), rgba(8,16,30,.97));
    box-shadow:
        0 0 0 1px rgba(0,0,0,.6),
        0 0 18px rgba(19,156,255,.35),
        inset 0 0 40px rgba(0,0,0,.55),
        0 18px 40px rgba(0,0,0,.6);
}
/* corner rivets */
.cwp-card::before,
.cwp-card::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px;
    height: 10px;
    pointer-events: none;
    background:
        radial-gradient(circle at 5px 5px, #7d8ea6 0 2px, #2a3547 3px, transparent 4.5px) left / 10px 10px no-repeat,
        radial-gradient(circle at 5px 5px, #7d8ea6 0 2px, #2a3547 3px, transparent 4.5px) right / 10px 10px no-repeat;
}
.cwp-card::before { top: 8px; }
.cwp-card::after  { bottom: 8px; }

.cwp-card--narrow { max-width: 660px; }
.cwp-card--narrow.cwp-msg {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 15px;
}
.cwp-card--signup { max-width: 540px; flex: 1 1 540px; padding: 24px 32px 24px; }
.cwp-card--side   { max-width: 400px; flex: 1 1 400px; padding: 24px 28px 24px; }
/* Create Account: scale the card column down slightly so the footer fits on
   screen like Forgot Password (artwork/hero are outside .cwp-main, unscaled). */
.cwp-main:has(.cwp-card--signup) { zoom: .85; }
/* Reserve the loaded hCaptcha height so register.php's fit script measures the final card height. */
.cwp-card--signup .h-captcha { min-height: 82px; }

/* --- Display headings ---------------------------------------------------- */
.cwp-title {
    margin: 0 0 4px;
    text-align: center;
    font: italic 900 44px/1.05 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
    letter-spacing: .5px;
    color: #f4f6fa;
    text-shadow:
        2px 2px 0 #000,
        -1px -1px 0 #1b2230,
        0 4px 10px rgba(0,0,0,.7);
    transform: rotate(-2deg);
}
.cwp .cwp-accent {
    color: var(--cwp-blue);
    text-shadow: 2px 2px 0 #02101f, 0 0 16px rgba(19,156,255,.45);
}
.cwp-title::after {
    content: "";
    display: block;
    width: 62%;
    height: 6px;
    margin: 8px auto 0;
    border-radius: 50% 40% 60% 30%;
    background: linear-gradient(90deg, transparent, var(--cwp-blue) 18%, var(--cwp-blue-hi) 60%, transparent);
    transform: skewX(-25deg);
}
.cwp-subtitle {
    margin: 8px 0 16px;
    text-align: center;
    font: 700 18px/1.3 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--cwp-blue-hi);
}
.cwp-card--side .cwp-title { font-size: 34px; }

/* --- Forms --------------------------------------------------------------- */
.cwp-field {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 4px 18px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px solid rgba(19,156,255,.10);
}
.cwp-field:last-of-type { border-bottom: 0; }
.cwp-card--signup .cwp-field { grid-template-columns: 165px 1fr; }
.cwp-field--stack { grid-template-columns: 1fr; }

.cwp-label {
    display: block;
    font-weight: 700;
    font-size: 14.5px;
    color: #fff;
}
.cwp-help {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    color: var(--cwp-muted);
}

.cwp input[type="text"],
.cwp input[type="email"],
.cwp input[type="password"],
.cwp textarea {
    display: block;
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid rgba(19,156,255,.65);
    border-radius: 6px;
    background-color: var(--cwp-field);
    background-repeat: no-repeat;
    background-position: 12px 50%;
    background-size: 16px 16px;
    color: #fff;
    font: 14px/1.4 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
    transition: border-color .15s, box-shadow .15s;
}
.cwp textarea { min-height: 120px; resize: vertical; background-position: 12px 10px; }
.cwp input:focus,
.cwp textarea:focus {
    border-color: var(--cwp-blue-hi);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.5), 0 0 0 3px rgba(19,156,255,.28);
    outline: none;
}
.cwp input::placeholder { color: #6f809a; }

/* Inline SVG icons (no remote icon CDN) */
.cwp .cwp-ico-mail   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3.5 6l8.5 7 8.5-7'/%3E%3C/svg%3E"); }
.cwp .cwp-ico-user   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='1.8'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7'/%3E%3C/svg%3E"); }
.cwp .cwp-ico-lock   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='1.8'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 018 0v3'/%3E%3C/svg%3E"); }
.cwp .cwp-ico-star   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.8-4.5 4.2 1.1 6.1L12 16.8l-5.4 2.9 1.1-6.1-4.5-4.2 6.1-.8z'/%3E%3C/svg%3E"); }
.cwp .cwp-ico-chat   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E"); }

/* Radios */
.cwp-radios { display: flex; flex-wrap: wrap; gap: 8px 26px; padding-top: 4px; }
.cwp-radio {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 14px;
    color: var(--cwp-text);
}
.cwp-radio input { width: 17px; height: 17px; margin: 0; accent-color: var(--cwp-blue); }
.cwp-radio img { vertical-align: middle; }

/* CAPTCHA */
.cwp-captcha { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 18px 0 6px; }
.cwp-captcha-label { font-weight: 700; color: #fff; }

/* Live-check status + password strength (inline colours come from existing JS) */
.cwp-status { font-size: 12px; margin-top: 5px; }

/* Primary action button */
.cwp .cwp-btn {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 14px auto 0;
    padding: 9px 20px;
    border: 1px solid #6cc6ff;
    border-radius: 5px;
    background:
        radial-gradient(circle at 4% 30%, rgba(255,255,255,.35) 0 2px, transparent 3px),
        radial-gradient(circle at 96% 70%, rgba(255,255,255,.35) 0 2px, transparent 3px),
        linear-gradient(180deg, #2fb0ff 0%, var(--cwp-blue) 45%, var(--cwp-blue-deep) 100%);
    color: #fff;
    font: italic 900 22px/1.1 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #032c57;
    box-shadow: 0 0 14px rgba(19,156,255,.5), inset 0 1px 0 rgba(255,255,255,.35);
    cursor: pointer;
    transition: filter .15s, transform .1s;
}
.cwp .cwp-btn:hover { filter: brightness(1.12); }
.cwp .cwp-btn:active { transform: translateY(1px); }
.cwp .cwp-btn--link { text-decoration: none; text-align: center; max-width: 320px; }

.cwp-fineprint { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--cwp-muted); }

/* --- Messages / alerts --------------------------------------------------- */
.cwp-alert {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(224,65,58,.7);
    border-left-width: 4px;
    border-radius: 4px;
    background: var(--cwp-red-bg);
    color: #ffd7d4;
}
.cwp-alert ul { margin: 6px 0 0 18px; padding: 0; }
.cwp-alert p { margin: 0; }
.cwp-success {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(63,208,127,.6);
    border-left-width: 4px;
    border-radius: 4px;
    background: rgba(30,120,70,.2);
    color: #d6ffe6;
}

/* Generic message card body (signup result, forgot-password steps) */
.cwp-msg h2 {
    margin: 0 0 18px;
    text-align: center;
    font: italic 900 38px/1.1 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
    color: #f4f6fa;
    text-shadow: 2px 2px 0 #000, 0 4px 10px rgba(0,0,0,.7);
}
.cwp-msg h3 { margin: 0 0 12px; color: var(--cwp-blue-hi); font-size: 22px; }
.cwp-msg p { margin: 0 0 12px; }

/* --- Forgot-password layout --------------------------------------------- */
.cwp-lead { max-width: 480px; margin: 0 auto 14px; text-align: center; font-size: 15px; }
.cwp-narrow-form { max-width: 480px; margin: 0 auto; }
.cwp-narrow-form .cwp-label { margin-bottom: 6px; }
.cwp-narrow-form .cwp-field { display: block; border: 0; padding: 6px 0; }
.cwp-reset-help { display: block; margin-top: -2px; font-size: 12.5px; font-style: italic; color: var(--cwp-muted); }
.cwp-or {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 380px;
    margin: 18px auto 8px;
    color: var(--cwp-muted);
    font-size: 14px;
}
.cwp-or::before, .cwp-or::after { content: ""; flex: 1; height: 1px; background: rgba(159,176,200,.35); }
.cwp-back { text-align: center; margin: 0; font-size: 16px; }

/* --- Signup side panel --------------------------------------------------- */
.cwp-welcome p { margin: 0 0 12px; font-size: 13.5px; color: #d5deea; }
.cwp-welcome strong { color: #fff; }
.cwp-discord {
    margin-top: 18px !important;
    padding: 14px 16px;
    border: 1px solid rgba(114,137,218,.8);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(88,101,242,.30), rgba(60,70,190,.22));
    box-shadow: 0 0 12px rgba(88,101,242,.35);
}
.cwp-discord a { color: #b9c3ff !important; }

/* --- Philosophy page ---------------------------------------------------- */
.cwp-card--philosophy { max-width: 760px; padding: 32px 52px 36px; }
.cwp-phil-body { max-width: 660px; margin: 0 auto; font-size: 15px; line-height: 1.7; color: #dbe3ee; }
.cwp-phil-body p { margin: 0 0 16px; }
.cwp-phil-body h2 {
    margin: 28px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(19,156,255,.3);
    font: italic 900 20px/1.2 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--cwp-blue-hi);
}
.cwp-phil-cta { margin-top: 28px; text-align: center; }
.cwp-phil-cta .cwp-btn { display: inline-block; width: auto; max-width: none; padding: 12px 48px; font-size: 24px; }

/* --- Legal pages (ToS / Privacy) ---------------------------------------- */
.cwp-card--legal { max-width: 960px; padding: 28px 52px 32px; }
.cwp-updated {
    margin: 12px 0 24px;
    text-align: center;
    font-weight: 700;
    color: var(--cwp-blue-hi);
}
.cwp-legal {
    max-width: 820px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.65;
    color: #dbe3ee;
}
.cwp-legal p { margin: 0 0 14px; }
.cwp-legal ul { margin: 0 0 14px; padding-left: 22px; }
.cwp-legal li { margin-bottom: 6px; }
.cwp-legal strong { color: #fff; }
.cwp-legal h2,
.cwp-legal h3 {
    margin: 30px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(19,156,255,.35);
    font: italic 900 21px/1.2 Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--cwp-blue);
    text-shadow: 1px 1px 0 #000;
}
.cwp-legal > section:first-child h2 { margin-top: 0; }
.cwp-legal-section { padding-top: 2px; }
.cwp-legal .cwp-clause { color: var(--cwp-blue-hi); }
.cwp-legal-actions { margin-top: 26px; }

/* --- Footer strip — matches homepage .lp-copyright ---------------------- */
.cwp-footer {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 6px 0;
    padding: 12px 24px;
    border-top: 1px solid rgba(82, 184, 255, .3);
    background: rgba(4, 10, 28, .88);
    font: 12px/1.6 Arial, sans-serif;
    color: #6a8aaa;
}
.cwp-footer nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0; }
.cwp-footer nav a { color: #a8d4f5; text-decoration: none; }
.cwp-footer nav a:hover { color: #fff; text-decoration: underline; }
.cwp-footer nav a strong { color: #52b8ff; font-weight: bold; }
.cwp-footer nav span { margin: 0 8px; color: #2a3a50; }

/* --- Google / Discord sign-in buttons ----------------------------------- */
.cwp .cw-oauth { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 2px; }
.cwp .cw-oauth-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 52px;
    border-radius: 6px;
    font: 600 16px/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    transition: filter .15s, box-shadow .15s;
}
.cwp .cw-oauth-btn svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); }
.cwp .cw-oauth-google  { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.cwp .cw-oauth-discord { background: #5865f2; color: #fff; border: 1px solid #4752c4; }
.cwp .cw-oauth-btn:hover { filter: brightness(1.05); box-shadow: 0 0 12px rgba(19,156,255,.4); }
.cwp .cw-oauth-google:hover,  .cwp .cw-oauth-google:focus  { color: #1f1f1f; }
.cwp .cw-oauth-discord:hover, .cwp .cw-oauth-discord:focus { color: #fff; }
.cwp .cw-oauth + .cwp-or { margin-top: 16px; }
.cwp .cwp-alert a, .cwp .cwp-success a { color: #fff; font-weight: 700; }
.cwp-oauth-as { margin: 0 0 14px; text-align: center; color: var(--cwp-muted); }
.cwp-oauth-as strong { color: #fff; }
