:root {
    --bg-deep: #0a0b14;
    --bg-card: #12141f;
    --bg-card-hover: #1a1d2e;
    --accent-purple: #8b5cf6;
    --accent-gold: #d4a853;
    --accent-gold-light: #f0d78c;
    --text-primary: #f4f0ff;
    --text-muted: #9ca3c7;
    --border-soft: rgba(139, 92, 246, 0.25);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --radius-lg: 20px;
    --radius-md: 14px;
    --phone-max: 430px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Outfit', system-ui, sans-serif;
    background: radial-gradient(ellipse at top, #151828 0%, var(--bg-deep) 55%, #050508 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

.app-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1.5px 1.5px at 80% 20%, rgba(212,168,83,0.5), transparent);
    background-size: 200px 200px;
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}

.phone-frame {
    position: relative;
    z-index: 1;
    max-width: var(--phone-max);
    min-height: 100vh;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(18,20,31,0.97) 0%, rgba(10,11,20,0.99) 100%);
    box-shadow: 0 0 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(139,92,246,0.1);
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,11,20,0.85);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 600;
}

.brand-icon { color: var(--accent-gold); }

.header-user {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-main {
    flex: 1;
    padding: 1rem 1.25rem 6rem;
    overflow-y: auto;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--phone-max);
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 11, 20, 0.82);
    border-top: 0.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 200;
}

.nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.15rem;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: rgba(244, 240, 255, 0.85);
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    color: inherit;
    opacity: 0.42;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-icon svg {
    width: 30px;
    height: 30px;
    display: block;
}

.nav-icon svg path {
    fill: currentColor;
    stroke: none;
}

.nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
    opacity: 0.85;
}

.nav-item.active .nav-label {
    opacity: 1;
    font-weight: 600;
}

.nav-item:active .nav-icon {
    transform: scale(0.88);
}

/* Splash */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1530 0%, #0a0b14 70%);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-stars {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='10' cy='20' r='1' fill='white' opacity='0.6'/%3E%3Ccircle cx='50' cy='60' r='0.8' fill='white' opacity='0.4'/%3E%3Ccircle cx='80' cy='30' r='1.2' fill='%23d4a853' opacity='0.5'/%3E%3C/svg%3E");
    animation: drift 20s linear infinite;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

.splash-moon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f0d78c, #d4a853 40%, transparent 70%);
    box-shadow: 0 0 60px rgba(212,168,83,0.4);
    margin-bottom: 1.5rem;
    animation: pulse-moon 3s ease-in-out infinite;
}

@keyframes pulse-moon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.splash-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-sub {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.splash-loader {
    display: flex;
    gap: 6px;
    margin-top: 2rem;
}

.splash-loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-purple);
    animation: bounce 1.2s ease-in-out infinite;
}

.splash-loader span:nth-child(2) { animation-delay: 0.15s; }
.splash-loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 1.5rem 0 2rem;
    animation: fadeUp 0.8s ease;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero-slogan {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.65rem;
}

.hero-tagline {
    color: rgba(244, 240, 255, 0.88);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0 0 1rem;
    padding: 0 0.25rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-visual {
    margin: 0 auto 1.25rem;
    max-width: 100%;
}

.hero-photo {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    background: transparent;
    object-fit: contain;
    object-position: center center;
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold), #b8862d);
    color: #1a1208;
    border: none;
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(212,168,83,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212,168,83,0.45);
    color: #1a1208;
}

.btn-outline-mystic {
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    background: transparent;
    border-radius: 999px;
    padding: 0.65rem 1.5rem;
}

.btn-outline-mystic:hover {
    background: rgba(139,92,246,0.15);
    color: var(--accent-gold-light);
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-glow);
    transition: transform 0.2s, border-color 0.2s;
}

.app-card:hover {
    border-color: rgba(139,92,246,0.45);
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--accent-gold-light);
}

.section-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.package-card {
    position: relative;
    overflow: hidden;
}

.package-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(139,92,246,0.2), transparent);
    border-radius: 50%;
}

.package-price {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin: 0.5rem 0;
}

.package-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(139,92,246,0.25);
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
}

.package-card.premium {
    border-color: rgba(212,168,83,0.4);
    background: linear-gradient(145deg, #1a1528 0%, var(--bg-card) 100%);
}

.form-control, .form-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background: rgba(0,0,0,0.4);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
}

.form-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.dream-history-card {
    cursor: default;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(139,92,246,0.2);
    color: var(--accent-gold-light);
}

.status-badge.completed {
    background: rgba(34,197,94,0.2);
    color: #86efac;
}

.status-badge.waiting {
    background: rgba(212,168,83,0.2);
    color: var(--accent-gold);
}

.app-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
}

.app-alert {
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.profile-stat {
    text-align: center;
    padding: 0.75rem;
}

.profile-stat .num {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.profile-stat .lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.report-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.report-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    color: var(--accent-gold-light);
    margin-bottom: 0.5rem;
}

.legal-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.25);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-purple);
}

.admin-link {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-soft);
}

.admin-link:hover {
    background: var(--bg-card-hover);
    color: var(--accent-gold-light);
}

.auth-card {
    max-width: 100%;
    margin-top: 1rem;
}

.detail-grid dt {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.detail-grid dd {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.corporate-box {
    border: 1px dashed rgba(212,168,83,0.35);
    background: rgba(212,168,83,0.05);
}

@media (min-width: 431px) {
    body {
        padding: 1rem 0;
    }
    .phone-frame {
        min-height: calc(100vh - 2rem);
        border-radius: 28px;
        overflow: hidden;
    }
}
