/* ==========================================================================
   Vieira Apps - Modern & Responsive Stylesheet
   ========================================================================== */

:root {
  --primary: #5c3bc4;
  --primary-hover: #482ca5;
  --primary-light: #ece8fc;
  --accent: #00b4d8;
  --text-main: #1f2430;
  --text-muted: #5e6678;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #5c3bc4;
  --error: #d90429;
  --error-bg: #fee2e2;
  --success: #10b981;
  --success-bg: #d1fae5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.2s ease-in-out;
  --max-width: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #7b57e8;
    --primary-hover: #8f6cf7;
    --primary-light: #251b47;
    --accent: #38bdf8;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --border-focus: #7b57e8;
    --error: #f87171;
    --error-bg: #451a1a;
    --success: #34d399;
    --success-bg: #064e3b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-sm);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  text-decoration: none;
}

/* Language Selector */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-main);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 8px;
}

.lang-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 14px;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
}

.lang-btn:hover {
  color: var(--text-main);
  text-decoration: none;
}

.lang-btn.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

@media (max-width: 992px) {
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: none;
    gap: 10px;
    align-items: stretch;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .lang-selector {
    margin-top: 10px;
    justify-content: center;
    align-self: center;
    width: fit-content;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 30px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.btn-danger {
  background-color: var(--error);
  color: #ffffff;
}

.btn-danger:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ==========================================================================
   Section Styles
   ========================================================================== */

.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* ==========================================================================
   Apps Grid & Cards
   ========================================================================== */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.app-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.app-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.app-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-main);
  padding: 4px;
}

.app-meta h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge.lang {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.app-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.app-features {
  list-style: none;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.app-features li {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.app-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: bold;
}

.app-oauth-note {
  font-size: 0.82rem;
  padding: 10px 12px;
  background-color: var(--bg-main);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border-left: 3px solid var(--primary);
  margin-top: auto;
}

/* ==========================================================================
   Compliance & Google OAuth Banner
   ========================================================================== */

.compliance-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: start;
}

.compliance-icon {
  font-size: 3rem;
  color: var(--primary);
  line-height: 1;
}

.compliance-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.compliance-content p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

.compliance-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.point-item {
  background: var(--bg-main);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.point-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.point-item span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 650px) {
  .compliance-box {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Legal Document Viewer Pages
   ========================================================================== */

.legal-header {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.legal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 60px;
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.legal-content h2 {
  font-size: 1.4rem;
  margin: 30px 0 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.legal-content h3 {
  font-size: 1.15rem;
  margin: 24px 0 10px;
  color: var(--text-main);
}

.legal-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-content ol,
.legal-content ul {
  margin: 14px 0 18px 24px;
  color: var(--text-muted);
}

.legal-content li {
  margin-bottom: 8px;
}

/* ==========================================================================
   Delete Data Form Page
   ========================================================================== */

.form-card {
  max-width: 640px;
  margin: 0 auto 60px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-helper {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(92, 59, 196, 0.15);
}

.alert-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  color: #92400e;
}

.alert-danger {
  background-color: var(--error-bg);
  border: 1px solid var(--error);
  color: var(--error);
}

.alert-success {
  background-color: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 30px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand h4 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 10px;
}

.footer-links h5 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

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

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
