/* =========================
   MyRunCard — app.css (VRC-style)
   Drop-in replacement (v1.5 polish)
   ========================= */

/* Reset / base */
* {
    box-sizing: border-box;
}

:root {
    /* VRC-like palette */
    --bg: #fff9f1;
    --surface: #ffffff;
    --border: #e6e9ed;

    --text: #1f2937;
    --muted: #6b7280;

    /* Brand accent (teal) */
    --primary: #32BDAE;
    --primary-hover: #28a79a;

    /* Warm RG badge */
    --rg-bg: #FDE6C8;
    --rg-border: #F4C997;
    --rg-text: #9A5B00;

    /* Status colours */
    --success-bg: #e7f7ee;
    --success-text: #1f6b3a;

    --error-bg: #fdeaea;
    --error-text: #8a1f1f;

    --warn-bg: #fff5db;
    --warn-text: #7a5a12;

    --info-bg: #e8f1ff;
    --info-text: #1a4aa0;

    /* UI */
    --radius: 14px;
    --radius-lg: 18px;

    --shadow: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-hover: 0 14px 40px rgba(0,0,0,0.08);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    padding: 0 20px;
    margin: 0 auto;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.header-nav .nav-link {
    margin-right: 16px;
    font-size: 0.95rem;
    color: var(--muted);
}

.header-nav .nav-link:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 10px 18px;

    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    cursor: pointer;
    user-select: none;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn-small {
    padding: 9px 12px;
    font-size: 0.95rem;
    min-height: 40px;
    line-height: 1.2;
}

.btn-large {
    padding: 14px 26px;
    font-size: 1.05rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

/* Hero (landing page) */
.hero {
    background: var(--bg);
    padding: 72px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.35rem;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 0 0 28px;
}

.hero-points {
    list-style: none;
    padding: 0;
    margin: 0 0 34px;
}

.hero-points li {
    margin-bottom: 8px;
    color: var(--text);
    opacity: 0.92;
}

/* Steps */
.steps {
    background: var(--surface);
    padding: 56px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    margin-bottom: 12px;
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 28px 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    font-weight: 600;
}

.footer-version {
    opacity: 0.6;
    font-weight: 500;
    margin-left: 6px;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: var(--muted);
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.75;
    max-width: 720px;
}

/* Flash messages */
.flash {
    padding: 12px 0;
    font-weight: 700;
}

.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error   { background: var(--error-bg);   color: var(--error-text); }
.flash-warning { background: var(--warn-bg);    color: var(--warn-text); }
.flash-info    { background: var(--info-bg);    color: var(--info-text); }

/* Auth */
.auth {
    padding: 64px 0;
}

.auth-inner {
    max-width: 440px;
    margin: 0 auto;
}

/* Wider layout for complex auth pages like edit */
.auth-wide {
    max-width: 920px;
}

/* Optional: even wider on large screens */
@media (min-width: 1200px) {
    .auth-wide {
        max-width: 1100px;
    }
}

/* Card / forms */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 18px;
    box-shadow: var(--shadow);
}

.card label {
    display: block;
    font-weight: 800;
    margin-top: 12px;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.card input,
textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.card input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(50, 189, 174, 0.6);
    box-shadow: 0 0 0 3px rgba(50, 189, 174, 0.18);
}

textarea {
    line-height: 1.5;
}

.auth-footnote {
    margin-top: 14px;
    color: var(--muted);
}

.auth-footnote a {
    color: var(--primary);
    font-weight: 800;
}

.auth-footnote a:hover {
    text-decoration: underline;
}

/* Help text */
.help-text {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--muted);
}

/* Pill */
.pill {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 800;
}



/* =========================
   Public profile (VRC style)
   ========================= */
.public-profile {
    padding: 36px 0 46px;
    background: var(--bg);
}

.profile-card {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px 22px;
}

.profile-card h1 {
    font-size: 2.15rem;
    margin: 6px 0 14px;
    letter-spacing: -0.02em;
}

.profile-card .hero-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 auto 18px;
    max-width: 520px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
    margin: 6px auto 16px;
    display: block;
}

/* Runner stats */
.runner-stats {
    margin: 18px auto 6px;
    max-width: 620px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    text-align: left;
}

.runner-stats .stat {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 10px 12px;
}

.runner-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 2px;
}

.runner-stats .stat-value {
    display: block;
    font-weight: 900;
    color: var(--text);
}

/* RG member badge (subtle warm) */
.rg-member-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin: 14px 0 18px;
    padding: 10px 14px;

    border-radius: 999px;
    background: var(--rg-bg);
    border: 1px solid var(--rg-border);
    color: var(--rg-text);

    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.profile-identity {
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 200;
}

/* Link buttons become full-width vertical list */
.profile-links {
    margin-top: 18px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.profile-links .btn {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    font-weight: 900;
    justify-content: center;
    text-align: center;

    box-shadow: 0 8px 18px rgba(0,0,0,0.10);
}

.profile-links svg {
    fill: currentColor;
    opacity: 0.92;
}

/* Public URL pill + Copy button */
.public-url-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-top: 18px;
    padding: 10px 14px;

    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 800;
    font-size: 0.95rem;

    max-width: 100%;
    word-break: break-word;
}

.copy-btn {
    appearance: none;
    border: 1px solid #dfe3e8;
    background: #ffffff;
    border-radius: 999px;
    padding: 6px 10px;

    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--text);
}

.copy-btn:hover {
    background: #f0f2f5;
}

.copy-btn.copied {
    background: #e6f7ec;
    border-color: #8bd3a8;
    color: #2f7a4e;
}

/* QR */
.qr-wrap {
    margin-top: 22px;
    text-align: center;
}

.qr-image {
    display: block;
    margin: 0 auto;
    padding: 12px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Subtle CTA under QR */
.card-cta {
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
}

.card-cta a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    padding-bottom: 2px;
}

.card-cta a:hover {
    border-bottom-color: rgba(0,0,0,0.35);
}

/* Subtle hover lift for public profile card */
@media (hover: hover) and (pointer: fine) {
    .profile-card {
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .profile-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }
}

/* Mobile refinements */
@media (max-width: 520px) {
    .hero {
        padding: 56px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .profile-card h1 {
        font-size: 1.9rem;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   Select styling (match inputs)
   ========================= */
.card select,
.auth select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--text);

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px),
        calc(100% - 2.2em) 0.5em;
    background-size:
        6px 6px,
        6px 6px,
        1px 1.5em;
    background-repeat: no-repeat;
}

.card select:focus,
.auth select:focus {
    outline: none;
    border-color: rgba(50, 189, 174, 0.7);
    box-shadow: 0 0 0 3px rgba(50, 189, 174, 0.18);
}

.card select:disabled {
    background: #f4f6f8;
    color: #999;
}

@media (max-width: 640px) {
    .card select {
        font-size: 0.95rem;
    }
}

/* =========================
   Checkbox row (register + other forms)
   ========================= */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex: 0 0 auto;
}

.checkbox-label {
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
}

.checkbox-label a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}