/*
 * ══════════════════════════════════════════════════════════
 *  首页专属登录面板 — 赛博朋克霓虹风格
 *  home-auth-panel.css
 * ══════════════════════════════════════════════════════════
 */

/* ── Overlay ── */
#home-auth-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 10, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#home-auth-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Card wrapper (animated border) ── */
.hap-wrap {
    position: relative;
    border-radius: 26px;
    padding: 4px;
    width: 420px;
    max-width: 96vw;
    transform: scale(0.88) translateY(24px);
    transition: transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#home-auth-overlay.visible .hap-wrap {
    transform: scale(1) translateY(0);
}

/* Rainbow animated glow border */
.hap-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 30px;
    background: linear-gradient(90deg,
        #ff007f, #ff4d00, #ffcc00,
        #00ff99, #00ccff, #7f00ff,
        #ff007f);
    background-size: 400% 100%;
    animation: hapBorderFlow 5s linear infinite;
    filter: blur(10px);
    opacity: 0.85;
    z-index: -1;
}
.hap-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: #090a0f;
    z-index: -1;
}
@keyframes hapBorderFlow {
    0%   { background-position: 0%   50%; }
    100% { background-position: 400% 50%; }
}

/* ── Card body ── */
.hap-card {
    position: relative;
    background: linear-gradient(145deg, #0d0e18, #0a0b15);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0;
    overflow: hidden;
}

/* Grid pattern (same as slot machine) */
.hap-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    border-radius: 22px;
}

/* ── Header slot-reel strip ── */
.hap-header {
    position: relative;
    padding: 28px 36px 20px;
    text-align: center;
    overflow: hidden;
}

/* Tiny colour-reel strip at top */
.hap-reel-strip {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.hap-reel-cell {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 8px currentColor;
}
.hap-reel-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: hapReelSpin 0.7s steps(1, end) infinite;
}
.hap-reel-inner .hap-reel-item {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
@keyframes hapReelSpin {
    0%   { transform: translateY(0); }
    14%  { transform: translateY(-28px); }
    28%  { transform: translateY(-56px); }
    42%  { transform: translateY(-84px); }
    56%  { transform: translateY(-112px); }
    70%  { transform: translateY(-140px); }
    84%  { transform: translateY(-168px); }
    100% { transform: translateY(-196px); }
}
/* Each cell has different animation delay */
.hap-reel-cell:nth-child(1) .hap-reel-inner { animation-delay: 0s;    animation-duration: 0.55s; }
.hap-reel-cell:nth-child(2) .hap-reel-inner { animation-delay: 0.12s; animation-duration: 0.7s;  }
.hap-reel-cell:nth-child(3) .hap-reel-inner { animation-delay: 0.24s; animation-duration: 0.85s; }
.hap-reel-cell:nth-child(4) .hap-reel-inner { animation-delay: 0.08s; animation-duration: 0.63s; }
.hap-reel-cell:nth-child(5) .hap-reel-inner { animation-delay: 0.18s; animation-duration: 0.78s; }

/* When auth panel is not visible, pause animation */
#home-auth-overlay:not(.visible) .hap-reel-inner {
    animation-play-state: paused;
}

.hap-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
    background: linear-gradient(90deg, #ff007f, #00ccff, #00ff99);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: hapTitleShimmer 4s linear infinite;
}
@keyframes hapTitleShimmer {
    0%   { background-position: 0%   50%; }
    100% { background-position: 200% 50%; }
}
.hap-subtitle {
    font-size: 13px;
    color: rgba(148,163,184,0.7);
    margin: 0;
}

/* ── Tabs ── */
.hap-tabs {
    display: flex;
    margin: 0 28px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.hap-tab {
    flex: 1;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(148,163,184,0.55);
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
    position: relative;
    background: none;
    border: none;
    font-family: inherit;
}
.hap-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.25s;
}
.hap-tab.active {
    color: #e2e8f0;
}
.hap-tab.active::after {
    background: linear-gradient(90deg, #ff007f, #7f00ff, #00ccff);
}

/* ── Forms ── */
.hap-form-area {
    padding: 24px 28px 28px;
}
.hap-panel { display: none; }
.hap-panel.active { display: block; }

.hap-field {
    margin-bottom: 16px;
}
.hap-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148,163,184,0.6);
    margin-bottom: 7px;
}
.hap-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: #e2e8f0;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.hap-input:focus {
    border-color: rgba(0, 204, 255, 0.6);
    background: rgba(0, 204, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 204, 255, 0.1),
                0 0 20px rgba(0, 204, 255, 0.08);
}
.hap-input::placeholder { color: rgba(100,116,139,0.6); }

.hap-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(148,163,184,0.7);
    cursor: pointer;
}
.hap-check-row input { accent-color: #00ccff; cursor: pointer; }

/* ── Submit button ── */
.hap-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #ff007f, #7f00ff, #00ccff, #00ff99);
    background-size: 300% 100%;
    color: #fff;
    letter-spacing: 0.04em;
    transition: background-position 0.4s, opacity 0.2s, transform 0.15s;
    animation: hapBtnShimmer 4s linear infinite;
}
.hap-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.hap-btn:active { transform: translateY(0); }
.hap-btn:disabled { opacity: 0.45; cursor: not-allowed; animation: none; }
@keyframes hapBtnShimmer {
    0%   { background-position: 0%   50%; }
    100% { background-position: 300% 50%; }
}

/* ── Divider ── */
.hap-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    font-size: 12px;
    color: rgba(100,116,139,0.5);
}
.hap-divider::before, .hap-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.07);
}

/* ── Google button ── */
.hap-google-btn {
    width: 100%;
    padding: 11px;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.hap-google-btn:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* ── Error message ── */
.hap-error {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 16px;
    display: none;
}
.hap-error.show { display: block; }

/* ── Close button ── */
.hap-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148,163,184,0.7);
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
    font-family: inherit;
}
.hap-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── User Panel (when logged in) ── */
.hap-user-header {
    text-align: center;
    padding: 32px 28px 20px;
}
.hap-user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0,204,255,0.4);
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(0,204,255,0.25);
}
.hap-user-avatar-letter {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff007f, #7f00ff);
    border: 3px solid rgba(0,204,255,0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(127,0,255,0.35);
}
.hap-user-name {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 4px;
}
.hap-user-email {
    font-size: 12px;
    color: rgba(100,116,139,0.7);
    margin: 0 0 20px;
}
.hap-user-links {
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hap-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.hap-user-link:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    transform: translateX(3px);
    color: #fff;
    text-decoration: none;
}
.hap-user-link i {
    width: 18px;
    text-align: center;
    opacity: 0.7;
}
.hap-user-link.danger {
    color: #fca5a5;
    border-color: rgba(220,38,38,0.15);
}
.hap-user-link.danger:hover {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.3);
    color: #fca5a5;
}
