/* ==================== LOCKET GOLD PREMIUM - USER PAGE ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Backgrounds */
    --bg-base: #07080a;
    --bg-panel: #0D0E12;
    --bg-panel-light: #111217;

    /* Gold colors */
    --gold-primary: #FFBE17;
    --gold-bright: #FFD94A;
    --gold-deep: #D58B00;
    --gold-dim: #C78000;

    /* Text */
    --text-primary: #F7F7F8;
    --text-secondary: rgba(255,255,255,0.68);
    --text-muted: rgba(255,255,255,0.44);

    /* Borders */
    --border: rgba(255,255,255,0.12);
    --border-gold: rgba(255,187,35,0.45);
    --border-gold-lite: rgba(255,190,30,0.18);

    /* Sizing */
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;

    /* Transitions */
    --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== BODY & STRUCTURE ==================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* ==================== CINEMATIC BACKGROUND (photo asset) ==================== */
.bg-photo {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: var(--bg-base);
    background-image: url('/static/bg-cinematic.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Very light vignette so the card border always reads clearly against any
   part of the photo, without flattening the background's own contrast */
.bg-photo-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 1000px 750px at 50% 45%, rgba(7,8,10,0.30) 0%, transparent 70%);
}

/* ==================== CONTENT WRAPPER ==================== */
.content-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 20px 40px;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 28px 16px 32px;
    }
}

/* ==================== LANGUAGE SWITCHER ==================== */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 20;
}

.lang-btn {
    padding: 5px 11px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.5);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--gold-primary);
    color: #101010;
    border-color: var(--gold-primary);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    text-align: center;
    margin-bottom: 18px;
    animation: fadeInDown 0.7s ease-out;
    position: relative;
    z-index: 10;
}

/* Logo Container */
.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 22px;
}

.locket-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    animation: logo-breathe 4s ease-in-out infinite;
}

.locket-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(255, 175, 0, 0.28)) drop-shadow(0 0 55px rgba(255, 175, 0, 0.16));
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.03) translateY(-3px); }
}

@media (max-width: 640px) {
    .locket-logo {
        width: 64px;
        height: 64px;
    }
}

/* Orbit dots */
.orbit-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold-bright);
    border-radius: 50%;
    opacity: 0.7;
    box-shadow: 0 0 8px rgba(255, 210, 90, 0.7);
    animation: orbit-spin 9s linear infinite;
}

.orbit-1 {
    width: 5px;
    height: 5px;
    top: 44%;
    left: -38px;
}

.orbit-2 {
    top: 20%;
    right: -42px;
    animation-delay: 4.5s;
}

@keyframes orbit-spin {
    from { opacity: 0.5; transform: rotate(0deg) translateX(38px) rotate(0deg); }
    to { opacity: 0.5; transform: rotate(360deg) translateX(38px) rotate(-360deg); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Title */
.title {
    font-size: 52px;
    font-weight: 780;
    letter-spacing: -1px;
    margin-bottom: 14px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

@media (max-width: 768px) {
    .title {
        font-size: 38px;
        margin-bottom: 10px;
    }
}

.title-main {
    color: var(--text-primary);
    display: inline;
}

.title-gold {
    background: linear-gradient(135deg, #FFF3B0 0%, #FFC83D 50%, #E9A600 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
    font-weight: 800;
}

/* Tagline */
.tagline {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@media (max-width: 768px) {
    .tagline { font-size: 16px; }
}

/* Description */
.description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 0;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== REDEMPTION CARD ==================== */
.redemption-card {
    width: min(660px, calc(100vw - 40px));
    background: linear-gradient(145deg, rgba(18, 18, 21, 0.92), rgba(10, 10, 12, 0.90));
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.55),
        0 0 55px rgba(255, 170, 0, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: fadeInUp 0.9s ease-out 0.4s both;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.redemption-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 100, 0.65), transparent);
    pointer-events: none;
}

@media (max-width: 768px) {
    .redemption-card {
        padding: 22px;
    }
}

.form-container {
    width: 100%;
}

/* ==================== FORM GROUPS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 9px;
    cursor: pointer;
}

.form-icon {
    width: 18px;
    height: 18px;
    color: var(--gold-primary);
    flex-shrink: 0;
}

.form-input {
    width: 100%;
    height: 58px;
    padding: 0 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    box-shadow: inset 0 1px rgba(255,255,255,0.025);
    transition: all var(--trans-fast);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.33);
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 193, 45, 0.85);
    box-shadow:
        0 0 0 3px rgba(255, 181, 0, 0.09),
        0 8px 25px rgba(0, 0, 0, 0.20);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-feedback {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    min-height: 0;
}

.input-feedback:empty {
    display: none;
}

.input-feedback.error {
    color: #FF6B6B;
}

.input-feedback.success {
    color: #51CF66;
}

/* ==================== USERNAME PROFILE CARD (auto-check preview) ==================== */
.profile-card:empty {
    display: none;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    animation: slideIn 0.25s ease-out;
}

.profile-card.loading {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 16px;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 190, 40, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 190, 40, 0.12);
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-muted);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-name-row svg {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-handle {
    font-size: 12.5px;
    color: #C9A6FF;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-uid {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.profile-badge.active {
    background: linear-gradient(100deg, #FFD94A, #FFA412);
    color: #1a1200;
}

.profile-badge.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* ==================== CTA BUTTON ==================== */
.btn-cta {
    width: 100%;
    height: 60px;
    padding: 0 20px;
    margin-top: 6px;
    background: linear-gradient(100deg, #FFE16B 0%, #FFC632 35%, #FFB315 100%);
    color: #111111;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--trans-fast);
    box-shadow:
        0 10px 30px rgba(255, 174, 0, 0.20),
        0 0 25px rgba(255, 191, 30, 0.10),
        inset 0 1px rgba(255, 255, 255, 0.45);
    position: relative;
}

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

.btn-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 14px 35px rgba(255, 174, 0, 0.25),
        0 0 32px rgba(255, 191, 30, 0.14),
        inset 0 1px rgba(255, 255, 255, 0.45);
}

.btn-cta:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.98);
}

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

/* ==================== PROCESSING STATE ==================== */
.processing-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== STATUS DISPLAY (no ghost box when empty) ==================== */
#status-display:empty,
#result-display:empty {
    display: none;
}

.status-display {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-display.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FF6B6B;
}

.status-display.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #74C0FC;
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-bright), var(--gold-primary));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

/* ==================== RESULT DISPLAY (golden theme, not green) ==================== */
.result-display {
    margin-top: 18px;
    padding: 22px;
    background: linear-gradient(135deg, rgba(255, 193, 30, 0.14), rgba(255, 152, 0, 0.05));
    border: 1px solid rgba(255, 193, 30, 0.35);
    border-radius: var(--radius-md);
    text-align: center;
    animation: scaleIn 0.4s ease-out;
}

.result-display.warning {
    background: linear-gradient(135deg, rgba(255, 159, 30, 0.16), rgba(255, 100, 0, 0.06));
    border-color: rgba(255, 159, 30, 0.4);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.result-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 8px;
}

.result-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.result-details {
    text-align: left;
    background: rgba(0,0,0,0.3);
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
}

.result-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.result-detail-row:last-child {
    margin-bottom: 0;
}

.result-detail-label {
    color: var(--text-muted);
}

.result-detail-value {
    color: var(--gold-bright);
    font-weight: 600;
}

/* ==================== INSTRUCTION CARD ==================== */
.instruction-card {
    width: min(660px, calc(100vw - 40px));
    background: rgba(12, 12, 14, 0.82);
    border: 1px solid rgba(255, 190, 40, 0.18);
    border-left: 3px solid #FFC12A;
    border-radius: var(--radius-md);
    padding: 22px 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.9s ease-out 0.5s both;
    z-index: 10;
}

.instruction-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.instruction-icon {
    width: 20px;
    height: 20px;
    color: var(--gold-bright);
    flex-shrink: 0;
}

.instruction-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-bright);
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.step {
    display: flex;
    gap: 12px;
}

.step-number {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 190, 40, 0.15);
    border: 1px solid rgba(255, 190, 40, 0.3);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-bright);
    flex-shrink: 0;
}

.step-text {
    font-size: 13px;
    color: rgba(255,255,255,0.68);
    padding-top: 3px;
    line-height: 1.5;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
    .hero-section {
        margin-bottom: 14px;
    }

    .title {
        font-size: 34px;
    }

    .tagline {
        font-size: 15px;
    }

    .description {
        font-size: 12px;
    }

    .redemption-card {
        padding: 18px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        height: 54px;
        font-size: 14px;
    }

    .btn-cta {
        height: 56px;
        font-size: 15px;
    }

    .instruction-card {
        padding: 16px;
    }

    .instruction-header {
        margin-bottom: 12px;
    }

    .instruction-steps {
        gap: 10px;
    }
}

/* ==================== DARK MODE & ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    body { color-scheme: dark; }
}
