/* club.css - Fina Club (cuenta del cliente y pantalla de puntos del staff) */
/* Usa las variables de style.css */

.club-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Arcos dorados de fondo (mismo lenguaje visual que el quiz) */
.neon-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, var(--secondary-green) 0%, #000 90%);
    overflow: hidden;
}

.neon-arch {
    position: absolute;
    left: 50%;
    border: 2px solid rgba(173, 152, 85, 0.1);
    border-top: 2px solid rgba(173, 152, 85, 0.6);
    border-radius: 50%;
    box-shadow: 0 -5px 20px rgba(173, 152, 85, 0.2);
    transform: translate(-50%, 20%);
    animation: clubArch 6s infinite ease-in-out;
    opacity: 0.3;
}

.neon-arch:nth-child(1) { bottom: -10vh; width: 80vw; height: 80vw; }
.neon-arch:nth-child(2) { bottom: -20vh; width: 120vw; height: 120vw; animation-delay: 2s; border-top-color: rgba(173, 152, 85, 0.4); }
.neon-arch:nth-child(3) { bottom: -30vh; width: 160vw; height: 160vw; animation-delay: 4s; border-top-color: rgba(173, 152, 85, 0.2); }

@keyframes clubArch {
    0%, 100% { opacity: 0.3; transform: translate(-50%, 20%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, 20%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    .neon-arch { animation: none; }
}

/* ---------- Barra superior ---------- */
.club-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
    max-width: 520px;
    margin: 0 auto;
}

.club-back,
.club-topbar-spacer {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
    text-decoration: none;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
}

.club-back:hover {
    color: var(--accent-gold);
    background: rgba(173, 152, 85, 0.1);
}

.club-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    letter-spacing: 6px;
    color: var(--accent-gold);
    text-decoration: none;
}

/* ---------- Layout ---------- */
.club-main {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px calc(40px + env(safe-area-inset-bottom));
}

.club-view {
    display: none;
    animation: clubFade 0.4s ease;
}

.club-view.active {
    display: block;
}

@keyframes clubFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.club-spinner {
    width: 42px;
    height: 42px;
    margin: 30vh auto 0;
    border: 3px solid rgba(173, 152, 85, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: clubSpin 0.9s linear infinite;
}

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

/* ---------- Hero ---------- */
.club-hero {
    text-align: center;
    margin: 10px 0 26px;
}

.club-script {
    font-family: var(--font-script);
    color: var(--accent-gold);
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: -6px;
}

.club-title {
    font-family: var(--font-heading);
    font-size: 4.2rem;
    letter-spacing: 14px;
    margin-right: -14px;
    color: var(--text-light);
    text-shadow: 0 0 25px rgba(173, 152, 85, 0.35);
    line-height: 1.05;
}

.club-lead {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 360px;
    margin: 14px auto 0;
}

/* ---------- Panel (glass) ---------- */
.club-panel {
    background: rgba(4, 28, 22, 0.6);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 26px 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.club-panel-title {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    color: var(--accent-gold);
    font-size: 1.6rem;
    margin-bottom: 18px;
    text-align: center;
}

.club-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50px;
    margin-bottom: 22px;
}

.club-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.club-tab.active {
    background: var(--accent-gold);
    color: var(--primary-green);
    font-weight: 600;
}

/* ---------- Formularios ---------- */
.club-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.club-form[hidden] {
    display: none;
}

.club-form h3 {
    font-family: var(--font-heading);
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    font-weight: 500;
    font-size: 1.15rem;
}

.club-form-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.club-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.club-field small {
    opacity: 0.7;
}

.club-field input,
.club-field select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(173, 152, 85, 0.3);
    border-radius: 14px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.club-field input:focus,
.club-field select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(173, 152, 85, 0.25);
}

.club-error {
    display: none;
    color: #ff8a80;
    background: rgba(84, 22, 24, 0.45);
    border: 1px solid rgba(255, 138, 128, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.club-error.visible {
    display: block;
}

.club-error .club-link {
    margin-top: 6px;
    color: var(--accent-gold);
}

.club-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--accent-gold);
    color: var(--primary-green);
    border: 1px solid var(--accent-gold);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s, color 0.3s;
}

.club-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(173, 152, 85, 0.45);
}

.club-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.club-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.club-btn-outline {
    background: transparent;
    color: var(--accent-gold);
}

.club-btn-outline:hover:not(:disabled) {
    background: rgba(173, 152, 85, 0.12);
}

.club-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.88rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    align-self: center;
    padding: 4px;
}

.club-link:hover {
    color: var(--accent-gold);
}

.club-fineprint {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.5;
}

.club-staff-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 28px auto 0;
    color: rgba(163, 184, 176, 0.6);
    font-size: 0.8rem;
    text-decoration: none;
    width: fit-content;
}

.club-staff-link:hover {
    color: var(--accent-gold);
}

/* ---------- Mensajes ---------- */
.club-message {
    text-align: center;
    margin-top: 8vh;
}

.club-message > ion-icon {
    font-size: 3.4rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 12px rgba(173, 152, 85, 0.5));
}

.club-message h2 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    font-size: 1.8rem;
    margin: 12px 0 10px;
}

.club-message p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.club-message .club-error {
    margin-top: 14px;
}

.club-message-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

/* ---------- Mi cuenta ---------- */
.club-greeting {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 6px 0 14px;
}

.club-greeting strong {
    color: var(--text-light);
    font-weight: 600;
}

.club-card {
    position: relative;
    border-radius: 20px;
    padding: 22px 24px;
    background:
        radial-gradient(circle at 110% -10%, rgba(173, 152, 85, 0.45), transparent 55%),
        linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 60%, #021510 100%);
    border: 1px solid rgba(173, 152, 85, 0.55);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.club-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: clubShimmer 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes clubShimmer {
    0%, 60% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .club-card::after { animation: none; display: none; }
}

.club-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--accent-gold);
}

.club-card-top ion-icon {
    font-size: 1.5rem;
}

.club-card-brand {
    font-family: var(--font-heading);
    letter-spacing: 4px;
    font-size: 1.1rem;
}

.club-card-brand em {
    font-family: var(--font-script);
    font-style: normal;
    letter-spacing: 0;
    font-size: 1.5rem;
    margin-left: 2px;
}

.club-card-points {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 18px;
}

.club-card-points span {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-light);
    text-shadow: 0 0 20px rgba(173, 152, 85, 0.4);
}

.club-card-points small {
    font-family: var(--font-heading);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-size: 1rem;
}

.club-card-expiry {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 1em;
}

.club-qr-box {
    margin-top: 18px;
    background: rgba(4, 28, 22, 0.6);
    border: 1px solid rgba(173, 152, 85, 0.25);
    border-radius: 20px;
    padding: 22px;
    text-align: center;
}

.club-qr {
    width: min(230px, 70vw);
    aspect-ratio: 1;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
}

.club-qr svg {
    width: 100%;
    height: 100%;
    display: block;
}

.club-qr-code {
    margin-top: 12px;
    font-family: var(--font-heading);
    letter-spacing: 5px;
    font-size: 1.3rem;
    color: var(--accent-gold);
}

.club-qr-help {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.club-rules {
    margin-top: 14px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.club-section-title {
    font-family: var(--font-heading);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-size: 1.3rem;
    font-weight: 500;
    margin: 32px 0 14px;
}

.club-rewards {
    display: grid;
    gap: 12px;
}

.club-reward {
    display: flex;
    gap: 14px;
    align-items: center;
    background: rgba(20, 20, 20, 0.55);
    border: 1px solid rgba(173, 152, 85, 0.18);
    border-radius: 16px;
    padding: 12px;
}

.club-reward.ready {
    border-color: rgba(173, 152, 85, 0.7);
    box-shadow: 0 0 18px rgba(173, 152, 85, 0.18);
}

.club-reward-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(6, 48, 35, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 1.6rem;
}

.club-reward-body {
    flex: 1;
    min-width: 0;
}

.club-reward-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
}

.club-reward-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.club-reward-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    gap: 8px;
}

.club-reward-cost {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 1rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.club-progress {
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 6px;
    overflow: hidden;
}

.club-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), #d8c47f);
    border-radius: 5px;
}

.club-badge {
    display: inline-block;
    background: var(--accent-gold);
    color: var(--primary-green);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.club-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
    padding: 18px;
    border: 1px dashed rgba(173, 152, 85, 0.25);
    border-radius: 14px;
    list-style: none;
}

.club-history {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.club-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.club-history-item strong {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
}

.club-history-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.club-history-points {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    white-space: nowrap;
}

.club-history-points.plus { color: #7fd6a4; }
.club-history-points.minus { color: #ff8a80; }

.club-settings {
    margin-top: 32px;
    background: rgba(20, 20, 20, 0.45);
    border: 1px solid rgba(173, 152, 85, 0.18);
    border-radius: 16px;
    padding: 0 18px;
}

.club-settings summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 16px 0;
    font-family: var(--font-heading);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-light);
    list-style: none;
}

.club-settings summary::-webkit-details-marker {
    display: none;
}

.club-settings[open] summary {
    color: var(--accent-gold);
}

.club-settings .club-form {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.club-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 24px auto 0;
}

/* ---------- Toast ---------- */
.club-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    max-width: calc(100% - 32px);
    background: var(--primary-green);
    border: 1px solid var(--accent-gold);
    color: var(--text-light);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    text-align: center;
}

.club-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.club-toast.error {
    background: var(--accent-red, #541618);
    border-color: #ff8a80;
}

/* =========================================
   PANTALLA DE PUNTOS (STAFF)
   ========================================= */
.staff-topbar {
    gap: 12px;
}

.staff-who {
    display: flex;
    flex-direction: column;
    color: var(--accent-gold);
    min-width: 0;
}

.staff-who small {
    color: var(--text-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-actions {
    display: flex;
    gap: 6px;
}

.staff-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(173, 152, 85, 0.3);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.3s, border-color 0.3s;
}

.staff-icon-btn[hidden] {
    display: none;
}

.staff-icon-btn:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.staff-scan {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.staff-scan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 20px;
    font-size: 1.2rem;
}

.staff-scan-btn[hidden],
.staff-scan .club-link[hidden] {
    display: none;
}

.staff-scan-btn ion-icon {
    font-size: 1.6rem;
}

.staff-reader {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--accent-gold);
    background: #000;
}

.staff-reader[hidden] {
    display: none;
}

.staff-reader video {
    width: 100% !important;
    display: block;
}

.staff-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 6px 0;
}

.staff-divider::before,
.staff-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(173, 152, 85, 0.25);
}

.staff-customer-card .club-card-top {
    align-items: flex-start;
    gap: 10px;
}

.staff-customer-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--text-light);
    line-height: 1.2;
    word-break: break-word;
}

.staff-customer-email {
    color: var(--text-muted);
    font-size: 0.8rem;
    word-break: break-all;
}

.staff-warning {
    margin-top: 14px;
}

.staff-block {
    margin-top: 16px;
}

.staff-block[hidden] {
    display: none;
}

.staff-block h3,
.staff-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    font-weight: 500;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.staff-block.club-form h3 {
    margin-bottom: 0;
}

.staff-preview {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    min-height: 1.4em;
}

.staff-preview strong {
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.staff-preview small {
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.staff-reward-btn {
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.3s;
}

.staff-reward-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.staff-reward-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.staff-reward-btn .club-reward-img {
    width: 48px;
    height: 48px;
}

.staff-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}

/* ---------- Mostrar / ocultar contraseña ---------- */
.club-password {
    position: relative;
    display: block;
}

.club-field .club-password input {
    padding-right: 52px;
}

.club-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.club-password-toggle:hover,
.club-password-toggle:focus-visible {
    color: var(--accent-gold);
    outline: none;
}

/* ---------- Aviso del tope diario ---------- */
.club-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(173, 152, 85, 0.1);
    border: 1px solid rgba(173, 152, 85, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
}

.club-notice ion-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--accent-gold);
    margin-top: 1px;
}

.staff-day-limit {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--accent-gold);
}

.staff-day-limit.reached {
    color: #ff8a80;
}
