/* ─────────────────────────────────────────
   Base & Typography
───────────────────────────────────────── */
* {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    background: #f8f9fb;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   Backgrounds & Gradients
───────────────────────────────────────── */
.main-gradient {
    background: linear-gradient(180deg,
        #ffffff 0%,
        #f4f6fb 40%,
        #e8ecf4 100%);
}

.dark-section {
    background: linear-gradient(135deg,
        #1a1f2e 0%,
        #2d3244 50%,
        #1a1f2e 100%);
}

/* ─────────────────────────────────────────
   Card Styles
───────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 24px rgba(31, 38, 135, 0.07),
        0 1px 6px rgba(31, 38, 135, 0.04);
}

.glass-dark {
    background: rgba(26, 31, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.neu-card {
    background: linear-gradient(145deg, #ffffff, #e6e9ef);
    box-shadow:
        8px 8px 24px #d1d5db,
        -8px -8px 24px #ffffff;
    border-radius: 16px;
}

.soft-shadow {
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.07),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.soft-shadow-lg {
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.09),
        0 4px 16px rgba(0, 0, 0, 0.05);
}

/* ─────────────────────────────────────────
   Hero Section Layout
───────────────────────────────────────── */
.hero-section {
    padding-top: 72px; /* navbar height */
    padding-bottom: 32px;
    min-height: 100svh;
}


/* ─────────────────────────────────────────
   Typography – Responsive Scale
───────────────────────────────────────── */
.hero-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    line-height: 1.6;
}

.stats-number {
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    line-height: 1;
}

.stats-label {
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
}

/* ─────────────────────────────────────────
   UI Components
───────────────────────────────────────── */
.urgency-banner {
    background: linear-gradient(90deg, #fff5f5, #fff0f0);
    border: 1px solid #fecaca;
}

.stock-input {
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: 52px;
    letter-spacing: 0.05em;
}

.cta-button {
    min-height: 54px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.quick-btn {
    min-height: 52px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quick-btn:hover,
.quick-btn:active {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow:
        0 4px 20px rgba(102, 126, 234, 0.45),
        0 2px 6px rgba(102, 126, 234, 0.25);
    color: white;
    border-radius: 14px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.45s;
}

.btn-primary:hover::before,
.btn-primary:active::before {
    left: 100%;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-1px);
    box-shadow:
        0 8px 28px rgba(102, 126, 234, 0.55),
        0 3px 10px rgba(102, 126, 234, 0.3);
}

/* ─────────────────────────────────────────
   Text Gradients
───────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.up { color: #10b981; }
.down { color: #ef4444; }

/* ─────────────────────────────────────────
   Background Decoration
───────────────────────────────────────── */
.floating-number {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    opacity: 0;
    animation: float-up 8s linear infinite;
    color: rgba(34, 197, 94, 0.55);
    pointer-events: none;
}

@keyframes float-up {
    0%   { opacity: 0; transform: translateY(100px); }
    10%  { opacity: 0.45; }
    90%  { opacity: 0.45; }
    100% { opacity: 0; transform: translateY(-100px); }
}

.chart-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.25;
    overflow: hidden;
    pointer-events: none;
}

.chart-line {
    position: absolute;
    bottom: 30%;
    left: -100%;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(34, 197, 94, 0.8) 25%,
        rgba(239, 68, 68, 0.8) 50%,
        rgba(59, 130, 246, 0.8) 75%,
        transparent 100%);
    animation: chart-flow 15s linear infinite;
}

@keyframes chart-flow {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(25%) translateY(-20px); }
    50%  { transform: translateX(50%) translateY(10px); }
    75%  { transform: translateX(75%) translateY(-30px); }
    100% { transform: translateX(100%) translateY(0); }
}

.candlestick {
    position: absolute;
    width: 8px;
    background: linear-gradient(180deg, #22c55e 0%, #ef4444 100%);
    opacity: 0.1;
    animation: candle-move 10s linear infinite;
}

.candlestick:nth-child(1) { left: 10%; height: 60px; bottom: 20%; animation-delay: 0s; }
.candlestick:nth-child(2) { left: 25%; height: 80px; bottom: 25%; animation-delay: 2s; }
.candlestick:nth-child(3) { left: 40%; height: 100px; bottom: 15%; animation-delay: 4s; }
.candlestick:nth-child(4) { left: 55%; height: 70px; bottom: 30%; animation-delay: 6s; }
.candlestick:nth-child(5) { left: 70%; height: 90px; bottom: 22%; animation-delay: 8s; }
.candlestick:nth-child(6) { left: 85%; height: 65px; bottom: 28%; animation-delay: 10s; }

/* Floating numbers – per-element position & delay */
.floating-number:nth-child(1)  { left: 10%; animation-delay: 0s; }
.floating-number:nth-child(2)  { left: 20%; animation-delay: 1s; }
.floating-number:nth-child(3)  { left: 30%; animation-delay: 2s; }
.floating-number:nth-child(4)  { left: 40%; animation-delay: 3s; }
.floating-number:nth-child(5)  { left: 50%; animation-delay: 4s; }
.floating-number:nth-child(6)  { left: 60%; animation-delay: 5s; }
.floating-number:nth-child(7)  { left: 70%; animation-delay: 6s; }
.floating-number:nth-child(8)  { left: 80%; animation-delay: 7s; }
.floating-number:nth-child(9)  { left: 90%; animation-delay: 8s; }

@keyframes candle-move {
    0%, 100% { transform: scaleY(1); opacity: 0.1; }
    50% { transform: scaleY(1.3); opacity: 0.25; }
}

/* ─────────────────────────────────────────
   Modals
───────────────────────────────────────── */
.modal-backdrop {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ─────────────────────────────────────────
   LINE Button
───────────────────────────────────────── */
.line-btn {
    background: linear-gradient(135deg, #00B900 0%, #00E000 100%);
    box-shadow:
        0 4px 20px rgba(0, 185, 0, 0.45),
        0 2px 6px rgba(0, 185, 0, 0.25);
    color: white;
    border-radius: 14px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    animation: line-pulse 2.5s ease-in-out infinite;
}

.line-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { left: -100%; }
    60%  { left: 100%; }
    100% { left: 100%; }
}

@keyframes line-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 185, 0, 0.45), 0 2px 6px rgba(0, 185, 0, 0.25); }
    50%       { box-shadow: 0 6px 32px rgba(0, 185, 0, 0.65), 0 3px 12px rgba(0, 185, 0, 0.4); }
}

.line-btn:active {
    transform: scale(0.98);
}

/* Result warning pulse */
.result-pulse {
    animation: result-pulse 1.8s ease-in-out infinite;
}

@keyframes result-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35); }
    50%       { box-shadow: 0 6px 28px rgba(239, 68, 68, 0.6); }
}

/* Risk bar animation */
.result-bar-animate {
    width: 0%;
    background: linear-gradient(90deg, #f97316, #ef4444);
    animation: bar-fill 1.2s ease-out 0.3s forwards;
}

@keyframes bar-fill {
    from { width: 0%; }
    to   { width: 72%; }
}

/* Analyzing progress bar */
.progress-bar-fill {
    width: 0%;
    animation: progress 3s ease-out forwards;
}

@keyframes progress {
    from { width: 0%; }
    to   { width: 100%; }
}

/* Blurred locked content */
.blurred-content {
    filter: blur(4px);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* ─────────────────────────────────────────
   Animations
───────────────────────────────────────── */
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 32px rgba(31, 38, 135, 0.12),
        0 6px 16px rgba(31, 38, 135, 0.08);
}

/* ─────────────────────────────────────────
   Mobile Overrides  (≤ 768px)
───────────────────────────────────────── */
@media (max-width: 768px) {

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

    /* Hide desktop decorations */
    .market-ticker,
    .floating-number,
    .candlestick,
    .chart-line {
        display: none !important;
    }

    /* Hero padding: navbar only on mobile */
    .hero-section {
        padding-top: 68px;
        padding-bottom: 24px;
        min-height: 100svh;
    }

    /* Tighter container */
    .container,
    .hero-section > .relative > * {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Ensure form cards have good padding */
    .glass-card.rounded-3xl {
        border-radius: 20px;
    }

    /* Input focus: prevent iOS scroll jump */
    input:focus {
        scroll-margin-top: 80px;
    }
}

/* ─────────────────────────────────────────
   Reduced Motion
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
