/* ============================================================
   Military Command — Auth Pages CSS
   Dark, utilitarian military aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Barlow:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg:           #0a0c0a;
    --bg-card:      #111510;
    --bg-input:     #0d110d;
    --border:       #2a3a2a;
    --border-focus: #4a7c4a;
    --green:        #4caf50;
    --green-dim:    #2d6b30;
    --green-glow:   rgba(76, 175, 80, 0.15);
    --amber:        #ffc107;
    --red:          #e53935;
    --text:         #c8d8c0;
    --text-muted:   #6a7a62;
    --text-bright:  #e8f0e0;
    --font-head:    'Rajdhani', sans-serif;
    --font-mono:    'Share Tech Mono', monospace;
    --font-body:    'Barlow', sans-serif;
}

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

/* ── Body ──────────────────────────────────────────────────── */
body.auth-page {
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(76, 175, 80, 0.03) 40px,
            rgba(76, 175, 80, 0.03) 41px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(76, 175, 80, 0.03) 40px,
            rgba(76, 175, 80, 0.03) 41px
        );
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    color: var(--text);
    padding: 2rem 1rem;
}

/* ── Container ─────────────────────────────────────────────── */
.auth-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ── Brand ─────────────────────────────────────────────────── */
.auth-brand {
    text-align: center;
}

.auth-logo {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 12px var(--green));
}

.auth-brand h1 {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-bright);
    text-shadow: 0 0 20px var(--green-glow);
}

.auth-tagline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

/* ── Card ──────────────────────────────────────────────────── */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

/* Corner accent */
.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    right: 30px;
    width: 60px;
    height: 2px;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.auth-card h2 {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
}

/* ── Form ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.input-wrap {
    position: relative;
}

.form-group input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

.input-wrap input {
    padding-right: 2.8rem;
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--green-glow), inset 0 0 8px rgba(76,175,80,0.05);
}

.form-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-family: var(--font-mono);
}

.toggle-pw {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 0.2rem;
}
.toggle-pw:hover { opacity: 0.8; }

/* ── Button ─────────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--green-dim);
    border: 1px solid var(--green);
    color: var(--text-bright);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: #3a7a3d;
    box-shadow: 0 0 16px var(--green-glow);
}

.btn-primary:active {
    background: var(--green-dim);
}

/* ── Errors ─────────────────────────────────────────────────── */
.auth-errors {
    margin-bottom: 1.25rem;
}

.auth-error {
    background: rgba(229, 57, 53, 0.1);
    border-left: 3px solid var(--red);
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: #ef9a9a;
    margin-bottom: 0.4rem;
    font-family: var(--font-mono);
}

.auth-error--info {
    background: rgba(255, 193, 7, 0.08);
    border-left-color: var(--amber);
    color: #ffe082;
}

/* ── Switch link ────────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    font-family: var(--font-mono);
}

.auth-switch a {
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: var(--text-bright);
    text-decoration: underline;
}

/* ── Flash messages (in-game) ───────────────────────────────── */
.flash {
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-left: 3px solid;
}

.flash--success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--green);
    color: #a5d6a7;
}

.flash--error {
    background: rgba(229, 57, 53, 0.1);
    border-color: var(--red);
    color: #ef9a9a;
}

.flash--info {
    background: rgba(255, 193, 7, 0.08);
    border-color: var(--amber);
    color: #ffe082;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
    .auth-brand h1 { font-size: 1.8rem; }
}

/* ── Country selection grid ─────────────────────────────────── */
.country-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.country-card {
    cursor: pointer;
    display: block;
}

.country-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.country-card__inner {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 0.6rem 0.7rem;
    transition: all 0.15s;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

.country-card:hover .country-card__inner {
    border-color: var(--border-focus);
    background: var(--bg-hover);
}

.country-card input:checked + .country-card__inner {
    border-color: var(--green);
    background: rgba(76,175,80,0.08);
    box-shadow: 0 0 8px var(--green-glow);
}

.country-card__flag {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.country-card__name {
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.05em;
}

.country-card__desc {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}

/* Wider auth card for country grid */
.auth-container { max-width: 520px; }
