/**
 * WeJoinLife – app.css v5
 * Proxon-style UX adapted with WJL turquoise branding (#00838F).
 * One-question-per-step wizard, opt-btn cards, sticky nav,
 * shake validation, loading spinners, stepIn transitions.
 */

/* ── RESET & CUSTOM PROPERTIES ── */
:root {
    --teal: #00838F;
    --teal2: #006974;
    --teal-light: #e0f4f5;
    --teal-rgb: 0, 131, 143;
    --ink: #0d1f35;
    --mu: #64748b;
    --bdr: #dbe3ea;
    --bg: linear-gradient(160deg, #f0f7f8 0%, #e4f0f1 100%);
    --radius: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    overscroll-behavior: none;
    line-height: 1.5;
}

/* ══════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════ */
.wjl-hero {
    background: linear-gradient(135deg, #00838F 0%, #00695C 100%);
    padding: 28px 16px 22px;
    text-align: center;
    color: #fff;
}

.wjl-hero-container {
    max-width: 620px;
    margin: auto;
}

.wjl-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.wjl-logo img {
    width: 100px;
    height: auto;
}

.wjl-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.wjl-hero h1 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 8px;
    color: #fff;
    letter-spacing: -0.2px;
}

.wjl-hero h1 span {
    color: #B2EBF2;
}

.wjl-hero p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
    margin: 0 auto;
    max-width: 520px;
}

.wjl-scroll {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 8px;
    animation: bounce 2s infinite;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wjl-scroll svg {
    width: 16px;
    height: 16px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
    60% { transform: translateY(-3px); }
}

/* ══════════════════════════════════════════
   SHELL & CARD
   ══════════════════════════════════════════ */
.shell {
    padding: 0 0 80px;
}

.wjl-main {
    padding-top: 0;
}

.wjl-card {
    background: #fff;
    border-radius: 0;
    padding: 22px 18px 24px;
    box-shadow: none;
    border: none;
    min-height: calc(100vh - 130px);
}

/* ══════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════ */
.wjl-progress {
    margin-bottom: 20px;
    padding-top: 4px;
}

.wjl-progress-bar {
    height: 5px;
    background: #e8edf3;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.wjl-progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--teal), #26C6DA);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wjl-step-indicator {
    font-size: 12px;
    margin-top: 8px;
    color: var(--mu);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wjl-step-indicator .pct {
    font-weight: 700;
    color: var(--teal);
}

/* ══════════════════════════════════════════
   STEPS
   ══════════════════════════════════════════ */
.wjl-step {
    display: none;
    animation: stepIn 0.22s ease;
}

.wjl-step.active {
    display: block;
}

@keyframes stepIn {
    from { opacity: 0; transform: translateX(18px); }
    to   { opacity: 1; transform: none; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.wjl-card h3 {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 18px;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.wjl-help {
    font-size: 13px;
    color: var(--mu);
    margin: -10px 0 16px;
    line-height: 1.4;
}

/* ══════════════════════════════════════════
   OPTION CARDS (opt-btn)
   ══════════════════════════════════════════ */
.opt-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.opt-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.opt-grid.cols-1 {
    grid-template-columns: 1fr;
}

.opt-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--bdr);
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    transition: all 0.18s;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    line-height: 1.3;
    font-family: var(--font);
}

.opt-btn .opt-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mu);
    transition: color 0.18s;
}

.opt-btn .opt-icon svg {
    width: 22px;
    height: 22px;
}

.opt-btn:active,
.opt-btn:hover {
    border-color: var(--teal);
    background: var(--teal-light);
}

.opt-btn.selected {
    border-color: var(--teal);
    background: var(--teal-light);
    color: var(--teal2);
    font-weight: 700;
}

.opt-btn.selected .opt-icon {
    color: var(--teal);
    transform: scale(1.1);
}

.opt-btn:hover .opt-icon,
.opt-btn:active .opt-icon {
    color: var(--teal);
}

/* Small variant for large grids (sectors, needs) */
.opt-btn-sm {
    padding: 10px 12px;
    font-size: 13px;
    gap: 8px;
}

.opt-btn-sm .opt-icon {
    width: 24px;
    height: 24px;
}

.opt-btn-sm .opt-icon svg {
    width: 18px;
    height: 18px;
}

/* Check indicator circle */
.opt-check {
    margin-left: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bdr);
    flex-shrink: 0;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opt-btn.selected .opt-check {
    background: var(--teal);
    border-color: var(--teal);
}

.opt-btn.selected .opt-check::after {
    content: "\2713";
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* ══════════════════════════════════════════
   FORM INPUTS (text, email, select, textarea)
   ══════════════════════════════════════════ */
.wjl-card input[type="text"],
.wjl-card input[type="email"],
.wjl-card input[type="url"],
.wjl-card input[type="tel"],
.wjl-card input[type="number"],
.wjl-card input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.wjl-card select,
.wjl-card textarea {
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--bdr);
    margin-bottom: 14px;
    background: #fff;
    font-size: 16px;
    transition: border 0.2s, box-shadow 0.2s;
    font-family: var(--font);
    color: var(--ink);
    -webkit-appearance: none;
    appearance: none;
}

.wjl-card select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
}

.wjl-card textarea {
    min-height: 100px;
    resize: none;
    line-height: 1.5;
}

.wjl-card input:focus,
.wjl-card select:focus,
.wjl-card textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(var(--teal-rgb), 0.1);
    outline: none;
}

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--mu);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* Date row layout (Q3, postal/city) */
.date-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.date-col {
    flex: 1;
}

.date-col select,
.date-col input {
    margin-bottom: 0;
}

/* Conditional field (Q6 social URL) */
.cond-field {
    margin-top: 12px;
    margin-bottom: 4px;
}

/* ══════════════════════════════════════════
   NAVIGATION BAR (sticky bottom)
   ══════════════════════════════════════════ */
.wjl-nav {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 14px 0 4px;
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
    border-top: 1px solid #f0f4f9;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

/* Primary button */
.wjl-btn {
    flex: 1;
    background: var(--teal);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.18s;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-appearance: none;
    min-height: 54px;
}

.wjl-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.wjl-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Back button */
.wjl-btn.secondary {
    flex: 0 0 54px;
    background: #f0f4f9;
    color: var(--teal2);
    font-size: 16px;
    padding: 0;
    border-radius: var(--radius);
}

.wjl-btn.secondary svg {
    width: 22px;
    height: 22px;
}

.wjl-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wjl-btn.secondary:active {
    background: #e4eaf5;
}

/* ══════════════════════════════════════════
   LOADING SPINNER (inside button)
   ══════════════════════════════════════════ */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.wjl-btn.loading .btn-text {
    display: none;
}

.wjl-btn.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   ERROR BOX
   ══════════════════════════════════════════ */
.wjl-error {
    display: none;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff0f0;
    color: #a61b1b;
    font-size: 14px;
    border-left: 3px solid #FF4343;
}

/* ══════════════════════════════════════════
   LEGAL / CONSENT TEXT
   ══════════════════════════════════════════ */
.wjl-legal-text {
    margin: 14px 0 10px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.wjl-legal-text a {
    color: var(--teal2);
    text-decoration: underline;
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.wjl-footer {
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    text-align: center;
}

.wjl-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 540px;
    margin: 0 auto;
    font-size: 12px;
    color: #9ca3af;
}

.wjl-footer-inner a {
    color: #6b7280;
    text-decoration: none;
}

.wjl-footer-inner a:hover {
    color: var(--teal);
}

/* ══════════════════════════════════════════
   COOKIE CONSENT BANNER
   ══════════════════════════════════════════ */
/* Cookie & Privacy Consent Overlay */
/* ── Cookie Banner (bottom bar) ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    animation: cookieSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner-hide {
    animation: cookieSlideDown 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes cookieSlideDown {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}
.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.cookie-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.cookie-banner-icon {
    flex-shrink: 0;
    color: var(--teal, #00b4d8);
    margin-top: 1px;
}
.cookie-banner-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}
.cookie-banner-text a {
    color: var(--teal, #00b4d8);
    text-decoration: underline;
    font-weight: 500;
}
.cookie-banner-text a:hover {
    color: #0096c7;
}
.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.btn-cookie-accept {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--teal, #00b4d8), #0096c7);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.25);
}
.btn-cookie-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.35);
}
.btn-cookie-reject {
    padding: 10px 18px;
    background: transparent;
    color: #777;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.btn-cookie-reject:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #555;
}
@media (max-width: 640px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        gap: 14px;
    }
    .cookie-banner-actions {
        justify-content: stretch;
    }
    .btn-cookie-accept,
    .btn-cookie-reject {
        flex: 1;
        text-align: center;
    }
}

/* ══════════════════════════════════════════
   DESKTOP BREAKPOINTS
   ══════════════════════════════════════════ */
@media (min-width: 640px) {
    .wjl-hero {
        padding: 36px 20px 32px;
    }

    .wjl-logo img {
        width: 100px;
    }

    .wjl-hero h1 {
        font-size: 32px;
    }

    .wjl-hero p {
        font-size: 15px;
    }

    .shell {
        padding: 0 16px 60px;
    }

    .wjl-main {
        padding-top: 24px;
    }

    .wjl-card {
        max-width: 540px;
        margin: 0 auto;
        border-radius: 24px;
        padding: 28px 28px 24px;
        box-shadow: 0 12px 48px rgba(0, 131, 143, 0.1);
        min-height: auto;
        border: 1px solid rgba(219, 227, 234, 0.8);
    }

    .wjl-nav {
        position: static;
        border-top: none;
        box-shadow: none;
        padding: 10px 0 0;
        margin: 0;
    }

    .wjl-footer-inner {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .wjl-hero h1 {
        font-size: 42px;
    }

    .wjl-hero p {
        font-size: 17px;
        max-width: 600px;
    }

    .wjl-logo img {
        width: 120px;
    }

    .wjl-scroll {
        display: block;
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════
   LEGAL PAGES (privacidad, aviso legal, cookies)
   ══════════════════════════════════════════ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-header {
    background: var(--dark, #1a1a2e);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-logo {
    height: 36px;
    width: auto;
}
.header-nav {
    display: flex;
    gap: 20px;
}
.header-nav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.header-nav a:hover {
    color: #fff;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    flex: 1;
}
.legal-page {
    line-height: 1.7;
    color: #333;
}
.legal-page h1 {
    font-size: 2rem;
    color: var(--dark, #1a1a2e);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--teal, #00b4d8);
}
.legal-page h2 {
    font-size: 1.35rem;
    color: var(--dark, #1a1a2e);
    margin-top: 36px;
    margin-bottom: 12px;
}
.legal-page h3 {
    font-size: 1.1rem;
    color: var(--dark, #1a1a2e);
    margin-top: 24px;
    margin-bottom: 8px;
}
.legal-page p {
    margin-bottom: 14px;
}
.legal-page em {
    color: #666;
    font-size: 0.92rem;
}
.legal-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 28px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}
.legal-info-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}
.legal-info-table tr:last-child td {
    border-bottom: none;
}
.legal-info-table td:first-child {
    width: 200px;
    font-weight: 500;
    color: #555;
}
.cookies-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 28px;
    font-size: 0.92rem;
}
.cookies-table th,
.cookies-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}
.cookies-table thead th {
    background: var(--dark, #1a1a2e);
    color: #fff;
    font-weight: 600;
}
.cookies-table tbody tr:hover {
    background: #f8f9fa;
}
.legal-links {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}
.legal-links a {
    color: var(--teal, #00b4d8);
    text-decoration: none;
    font-weight: 500;
}
.legal-links a:hover {
    text-decoration: underline;
}
.site-footer {
    background: var(--dark, #1a1a2e);
    color: rgba(255,255,255,0.6);
    padding: 20px 24px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}
.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}
/* Responsive */
@media (max-width: 600px) {
    .legal-page h1 { font-size: 1.5rem; }
    .legal-info-table td:first-child { width: auto; display: block; padding-bottom: 2px; }
    .legal-info-table td { display: block; }
    .cookies-table { font-size: 0.82rem; }
    .cookies-table th, .cookies-table td { padding: 8px 10px; }
    .header-nav { gap: 12px; }
    .header-nav a { font-size: 0.8rem; }
}
