@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --bg-color: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --danger: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}
.nav-brand { font-size: 1.25rem; font-weight: 700; color: var(--text-main); text-decoration: none; }
.nav-auth { display: flex; gap: 1rem; align-items: center; }

/* Buttons */
button, .btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #2563EB 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #4338CA 0%, #1D4ED8 100%);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #9CA3AF 0%, #D1D5DB 100%);
    box-shadow: none;
    cursor: not-allowed;
    color: #F3F4F6;
    transform: none;
}
.btn-outline { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background-color: var(--bg-color); border-color: #CBD5E1; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { background-color: #DC2626; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { background-color: #059669; }
.btn-full { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
  flex: 1;
}

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); font-size: 1rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover { border-color: #CBD5E1; box-shadow: var(--shadow-hover); }
.card-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; color: var(--text-main); }

/* Upload Zone */
.upload-zone {
  border: 2px dashed #9ca3af;
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  background-color: var(--bg-color);
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.upload-zone:hover { border-color: var(--primary); background-color: #EEF2FF; transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1); }
.upload-zone h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); transition: 0.3s; }
.upload-zone:hover h3 { color: var(--primary); }
.upload-zone p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; font-weight: 500; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  background-color: white;
  transition: all 0.25s ease;
}
.form-control:hover { border-color: #94A3B8; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); background-color: #fff; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Processing Status */
.status-area { margin-top: 1.5rem; }
.progress-bar-wrap { width: 100%; height: 8px; background-color: var(--border-color); border-radius: 4px; overflow: hidden; margin: 1rem 0; }
.progress-bar-fill { height: 100%; background-color: var(--primary); width: 0%; transition: width 0.3s ease; }
.terminal-box { background-color: #111827; color: #f3f4f6; padding: 1rem; border-radius: 4px; font-family: monospace; font-size: 0.75rem; height: 150px; overflow-y: auto; margin-top: 1rem; }

/* Pricing */
.pricing-section { margin-top: 5rem; padding-top: 4rem; border-top: 1px solid var(--border-color); position: relative; }
.pricing-title { text-align: center; font-size: 1.75rem; font-weight: 800; margin-bottom: 3rem; color: var(--text-main); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    background: white; 
    padding: 2.5rem 2rem; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    position: relative;
    --hover-color: #3B82F6; /* Default Pro Blue */
    --hover-shadow: rgba(37,99,235,0.25);
}
.price-card.free-tier {
    --hover-color: #16A34A; /* Free Green */
    --hover-shadow: rgba(22,163,74,0.25);
}
.price-card.featured { 
    position: relative; 
    box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.2); 
    transform: scale(1.02); 
    z-index: 5; 
    --hover-color: #F59E0B; /* Ultimate Gold */
    --hover-shadow: rgba(245,158,11,0.4);
    /* Removed static orange border so the animation can sweep over a standard grey border */
}

/* Fast Snake Line Tracking Animation */
.snake-border {
    position: absolute;
    top: -2px; left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    pointer-events: none;
    z-index: 10;
}
.snake-border rect {
    fill: none;
    stroke: var(--hover-color);
    stroke-width: 2.5px;
    /* Symmetrical Origin Math: A 0-length dash starting exactly at Top-Left */
    stroke-dasharray: 0 100;
    stroke-dashoffset: 0;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.25, 1);
}
.price-card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 0 35px var(--hover-shadow); 
}
.price-card.featured:hover { 
    transform: scale(1.02) translateY(-6px); 
}
.price-card:hover .snake-border rect {
    /* Symmetrical Convergence Math: Dash fully expands to 100 while shifting the gap to meet at Bottom-Right */
    stroke-dasharray: 100 0;
    stroke-dashoffset: -50;
}
.price-header { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.price-amount { font-size: 2.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); }
.price-features { list-style: none; margin-bottom: 1.5rem; flex: 1; }
.price-features li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); font-size: 0.875rem; color: var(--text-muted); }

/* Footer */
.footer { background-color: var(--card-bg); border-top: 1px solid var(--border-color); padding: 2rem; text-align: center; margin-top: auto; color: var(--text-muted); font-size: 0.875rem; }

/* 🔴 Global Mobile Responsiveness Enforcement */
@media (max-width: 650px) {
    /* Typographic & Hero Scaling */
    .page-header h1 { font-size: 2.1rem !important; margin-top: 1rem; }
    .page-header p { font-size: 0.95rem !important; }
    
    /* Layout Overrides */
    .app-nav { flex-direction: column; gap: 1rem; padding: 1rem; text-align: center; }
    .nav-brand { margin-bottom: 0.5rem; justify-content: center; }
    .main-container { padding: 0 0.5rem; margin: 1rem auto; }
    .dashboard-grid { gap: 1rem; }
    .card { padding: 1rem; }
    
    /* Auth Modal Strict Confinement */
    .card#authModalCard { padding: 1.5rem !important; max-width: 95% !important; margin: 0 auto; max-height: 95vh; overflow-y: auto; }
    #authModalTitle { font-size: 1.5rem !important; }
    #authModalSubtitle { font-size: 0.85rem !important; margin-bottom: 1.5rem !important; }
    
    /* Input Normalization */
    .form-control { font-size: 1rem !important; padding: 0.75rem 1rem !important; }
    input#authEmailInput, input#authPasswordInput { padding-left: 2.8rem !important; }
    #authOtpInput { letter-spacing: 4px !important; font-size: 1.25rem !important; padding-left: 2.5rem !important; }
    
    /* Legal Pages Glassmorphism Clamp */
    .legal-container { padding: 1.5rem !important; margin: 6rem 1rem 3rem 1rem !important; }
    .legal-container h1 { font-size: 2rem !important; }
    .legal-container h2 { font-size: 1.35rem !important; }
    .legal-container p { font-size: 0.95rem !important; }
}
