/**
 * Las 47 Señales - Premium Dark Theme CSS
 * Mobile-first, conversion-focused
 */

/* CSS Variables */
:root {
    --bg-dark: #0a0a12;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a24;
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --secondary: #EC4899;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gold: #FFD700;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ===================
   BUTTONS - Big & Tappable
   =================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
    /* Minimum touch target */
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #FFA500);
    color: #000;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-large {
    padding: 20px 32px;
    font-size: 1.1rem;
    min-height: 64px;
}

.btn-full {
    width: 100%;
}

.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(139, 92, 246, 0);
    }
}

/* ===================
   CARDS
   =================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-action:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.card-action .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-action .content {
    flex: 1;
}

.card-action .content h4 {
    margin-bottom: 4px;
}

.card-action .content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-action .arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* ===================
   AUTH PAGES
   =================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15), transparent 50%),
        var(--bg-dark);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-benefits {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.auth-benefits .benefit {
    font-size: 0.8rem;
    color: var(--success);
}

.auth-privacy {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===================
   ALERTS
   =================== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

/* ===================
   BADGES
   =================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ===================
   DASHBOARD
   =================== */
.dashboard {
    padding: 24px 16px;
    padding-bottom: 100px;
    max-width: 500px;
    margin: 0 auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 32px;
}

.dashboard-header .greeting {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.risk-score {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.risk-score .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.risk-score .score-bar {
    height: 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.risk-score .score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning), var(--danger));
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.risk-score .score-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.risk-score .score-text .level {
    color: var(--danger);
    font-weight: 600;
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

/* ===================
   SIGNALS LIST
   =================== */
.signals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signal-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.signal-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.signal-card.locked {
    opacity: 0.7;
    position: relative;
}

.signal-card.locked .info {
    filter: blur(4px);
    user-select: none;
}

.signal-card.locked .number {
    filter: blur(2px);
}

.signal-card.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(10, 10, 18, 0.3), transparent);
    pointer-events: none;
}

.signal-card .number {
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.signal-card.free .number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.signal-card .info {
    flex: 1;
    min-width: 0;
}

.signal-card .title {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.signal-card .category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.signal-card .lock-icon {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* ===================
   SIGNAL DETAIL
   =================== */
.signal-detail {
    padding: 24px 16px;
    max-width: 500px;
    margin: 0 auto;
}

.signal-header {
    text-align: center;
    margin-bottom: 24px;
}

.signal-header .category {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.signal-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.signal-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.signal-section h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-section p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===================
   DIARY
   =================== */
.diary-entry {
    padding: 24px 16px;
    max-width: 500px;
    margin: 0 auto;
}

.diary-header {
    text-align: center;
    margin-bottom: 24px;
}

.diary-form textarea {
    min-height: 150px;
    resize: none;
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.psychologist-response {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 24px;
}

.psychologist-response .avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.psychologist-response .name {
    font-weight: 600;
    margin-bottom: 4px;
}

.psychologist-response .title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.psychologist-response .message {
    font-size: 0.95rem;
    line-height: 1.7;
}

.response-pending {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-top: 24px;
}

.response-pending .icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.response-pending p {
    font-size: 0.9rem;
}

/* ===================
   PAYWALL
   =================== */
.paywall {
    padding: 24px 16px;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.paywall-header {
    margin-bottom: 32px;
}

.paywall-header .lock-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.paywall-header h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.paywall-features {
    text-align: left;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.paywall-features .feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.paywall-features .feature:last-child {
    border-bottom: none;
}

.paywall-features .feature .check {
    color: var(--success);
    font-size: 1.25rem;
}

.paywall-price {
    margin-bottom: 24px;
}

.paywall-price .old-price {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 8px;
}

.paywall-price .new-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--success);
}

.paywall-price .currency {
    font-size: 1.5rem;
}

.paywall-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===================
   BOTTOM NAV
   =================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bottom-nav a .icon {
    font-size: 1.5rem;
}

.bottom-nav a.active {
    color: var(--primary);
}

/* ===================
   UTILITIES
   =================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* ===================
   SCROLLBAR
   =================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===================
   RESPONSIVE
   =================== */
@media (min-width: 768px) {

    .dashboard,
    .signal-detail,
    .diary-entry,
    .paywall {
        max-width: 600px;
    }
}

/* ===================
   ANIMATIONS
   =================== */

/* Page Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Apply animations to elements */
.dashboard {
    animation: fadeIn 0.4s ease-out;
}

.auth-card {
    animation: scaleIn 0.5s ease-out;
}

.auth-logo {
    animation: slideUp 0.5s ease-out;
}

.dashboard-header {
    animation: slideUp 0.4s ease-out;
}

.level-card {
    animation: scaleIn 0.5s ease-out 0.1s both;
}

.stats-row {
    animation: slideUp 0.4s ease-out 0.15s both;
}

.risk-score {
    animation: slideUp 0.4s ease-out 0.2s both;
}

/* Staggered card animations */
.card-action,
.signal-card {
    animation: slideInRight 0.4s ease-out both;
}

.dashboard-actions .card-action:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-actions .card-action:nth-child(2) {
    animation-delay: 0.15s;
}

.dashboard-actions .card-action:nth-child(3) {
    animation-delay: 0.2s;
}

.dashboard-actions .card-action:nth-child(4) {
    animation-delay: 0.25s;
}

.signals-list .signal-card:nth-child(1) {
    animation-delay: 0.05s;
}

.signals-list .signal-card:nth-child(2) {
    animation-delay: 0.1s;
}

.signals-list .signal-card:nth-child(3) {
    animation-delay: 0.15s;
}

.signals-list .signal-card:nth-child(4) {
    animation-delay: 0.2s;
}

.signals-list .signal-card:nth-child(5) {
    animation-delay: 0.25s;
}

.signals-list .signal-card:nth-child(6) {
    animation-delay: 0.3s;
}

.signals-list .signal-card:nth-child(7) {
    animation-delay: 0.35s;
}

.signals-list .signal-card:nth-child(8) {
    animation-delay: 0.4s;
}

.signals-list .signal-card:nth-child(n+9) {
    animation-delay: 0.45s;
}

/* Button hover effects */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.97);
}

/* Card hover lift effect */
.card-action,
.signal-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-action:hover,
.signal-card:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Premium badge shimmer */
.badge-premium {
    background-size: 200% 100%;
    background-image: linear-gradient(90deg,
            rgba(255, 215, 0, 0.2) 0%,
            rgba(255, 165, 0, 0.4) 50%,
            rgba(255, 215, 0, 0.2) 100%);
    animation: shimmer 3s infinite linear;
}

/* Gold button shimmer */
.btn-gold {
    background-size: 200% 100%;
    background-image: linear-gradient(90deg,
            #FFD700 0%,
            #FFA500 25%,
            #FFEC8B 50%,
            #FFA500 75%,
            #FFD700 100%);
    animation: shimmer 2s infinite linear;
}

/* Success alert entrance */
.new-response-alert {
    animation: bounceIn 0.6s ease-out;
}

/* Paywall entrance */
.paywall {
    animation: fadeIn 0.5s ease-out;
}

.price-section {
    animation: scaleIn 0.5s ease-out 0.2s both;
}

.payment-form {
    animation: slideUp 0.5s ease-out 0.3s both;
}

/* Signal detail page */
.signal-detail {
    animation: fadeIn 0.4s ease-out;
}

.signal-header {
    animation: slideUp 0.4s ease-out;
}

.signal-section {
    animation: slideUp 0.4s ease-out both;
}

.signal-section:nth-child(1) {
    animation-delay: 0.1s;
}

.signal-section:nth-child(2) {
    animation-delay: 0.2s;
}

.signal-section:nth-child(3) {
    animation-delay: 0.3s;
}

/* Diary page */
.diary-entry {
    animation: fadeIn 0.4s ease-out;
}

.psychologist-response {
    animation: slideUp 0.5s ease-out;
}

/* Bottom nav smooth */
.bottom-nav a {
    transition: all 0.2s ease;
}

.bottom-nav a:active {
    transform: scale(0.9);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}