/* Reechex — Global Styles */
:root {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-alt: #16162b;
    --text: #e8e8f0;
    --text-muted: #8888a8;
    --text-dim: #5a5a78;
    --primary: #6c63ff;
    --primary-hover: #5a52e0;
    --primary-light: rgba(108, 99, 255, 0.15);
    --accent: #ff6584;
    --success: #2dd4a8;
    --warning: #ffb84d;
    --danger: #ff4d6a;
    --border: #2a2a45;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Page Management */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

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

/* Hero */
.hero {
    padding: 5rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections */
.section {
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section-alt {
    background: var(--bg-alt);
    max-width: 100%;
    padding-left: calc((100% - 1100px) / 2 + 2rem);
    padding-right: calc((100% - 1100px) / 2 + 2rem);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

/* Three Moments */
.moments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.moment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.moment-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.moment-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.moment-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.moment-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature {
    padding: 1.5rem;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature h4 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.price-card.featured {
    border-color: var(--primary);
    position: relative;
}

.price-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 1rem;
}

.price-original {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.price-amount {
    margin-bottom: 0.5rem;
}

.price-dollar {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.price-period {
    font-size: 1rem;
    color: var(--text-muted);
}

.price-billed {
    font-size: 0.85rem;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.price-features {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.price-features li {
    padding: 0.4rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-features li::before {
    content: "\2713 ";
    color: var(--success);
    margin-right: 0.5rem;
}

.pricing-trials {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-dim);
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.auth-back {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 2rem;
}

.auth-logo {
    display: block;
    margin-bottom: 1.5rem;
}

.auth-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    padding: 0.2rem;
}

.password-toggle:hover { opacity: 1; }

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* App Shell */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.app-menu-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem;
}

.app-menu {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.app-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.app-menu a:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    text-decoration: none;
}

.hidden { display: none !important; }

.app-view { display: none; padding: 1.5rem; }
.app-view.active { display: block; }

/* Dashboard */
.dashboard-greeting {
    margin-bottom: 2rem;
}

.dashboard-greeting h2 {
    font-size: 1.5rem;
}

.dashboard-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
    font-family: var(--font);
}

.action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.action-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.ask-btn { border-color: var(--primary); }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Record View */
.record-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem;
}

.record-controls {
    text-align: center;
}

.record-status {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    min-height: 1.5em;
}

.record-status.recording {
    color: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.record-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mic-btn, .camera-btn, .receipt-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.mic-btn:hover { border-color: var(--danger); }
.camera-btn:hover { border-color: var(--primary); }
.receipt-btn:hover { border-color: var(--warning); }

.mic-btn.active {
    background: var(--danger);
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

.record-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.record-previews img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.record-text-fallback {
    margin-bottom: 1.5rem;
}

.record-text-fallback textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    resize: vertical;
}

.record-result {
    text-align: left;
    margin-top: 2rem;
}

.record-result h4 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.result-item {
    padding: 0.8rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Ask View */
.ask-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
}

.ask-history {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.ask-bubble {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ask-bubble.user {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ask-bubble.assistant {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ask-input-row {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.ask-mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ask-input-row input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
}

.ask-input-row input:focus { outline: none; border-color: var(--primary); }

.ask-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Lists */
.list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.list-header h3 { flex: 1; }

.add-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
}

.list-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.list-filters select,
.list-filters input {
    flex: 1;
    padding: 0.5rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
}

.item-list .list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.list-item-info { flex: 1; }

.list-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-item-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-in_stock { background: rgba(45, 212, 168, 0.15); color: var(--success); }
.status-low { background: rgba(255, 184, 77, 0.15); color: var(--warning); }
.status-empty { background: rgba(255, 77, 106, 0.15); color: var(--danger); }

/* Account */
.account-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.account-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.account-row:last-child { border-bottom: none; }

.account-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.account-value {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links a:not(.btn) { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 3rem 1.5rem 2rem; }
    .section { padding: 3rem 1.5rem; }
    .section-alt { padding-left: 1.5rem; padding-right: 1.5rem; }
    .pricing-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
    .action-buttons { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Utility */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    font-size: 0.9rem;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
