/**
 * Seguridad Page Styles - Portal iAudita
 *
 * Estilos específicos para la página de Seguridad.
 * Todas las clases con prefijo seg- para evitar conflictos.
 *
 * @package iAudita\Portal
 * @version 1.0.0
 */

/* ========================================
   VARIABLES SCOPED
   ======================================== */
.seg-page {
  --seg-coral: #ef4444;
  --seg-coral-dim: rgba(239, 68, 68, 0.12);
  --seg-blue: #60a5fa;
  --seg-blue-dim: rgba(96, 165, 250, 0.12);
  --seg-green: var(--color-accent);
  --seg-green-dim: rgba(6, 214, 160, 0.12);
  --seg-purple: var(--color-primary-light);
  --seg-purple-dim: rgba(139, 92, 246, 0.12);
  --seg-amber: var(--color-warning);
  --seg-amber-dim: rgba(245, 158, 11, 0.12);
  --seg-accent: var(--color-accent);
  --seg-accent-glow: rgba(6, 214, 160, 0.12);
  --seg-accent-border: rgba(6, 214, 160, 0.2);
  --seg-bg: var(--color-bg-deep);
  --seg-bg-card: rgba(255,255,255,0.05);
  --seg-text: var(--color-text-white);
  --seg-text-secondary: rgba(255,255,255,0.6);
  --seg-text-muted: rgba(255,255,255,0.35);
  --seg-border: var(--color-border-subtle);

  background: var(--seg-bg);
  color: var(--seg-text);
  line-height: 1.7;
}

/* Noise overlay */
.seg-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Override framework heading styles within seg-page */
.seg-page h1,
.seg-page h2,
.seg-page h3,
.seg-page h4 {
  color: var(--seg-text);
  font-family: var(--font-heading);
}

/* ========================================
   CONTAINER
   ======================================== */
.seg-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   HERO
   ======================================== */
.seg-hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
}

.seg-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 214, 160, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.seg-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--seg-accent);
  padding: 8px 20px;
  border-radius: 24px;
  background: var(--seg-accent-glow);
  border: 1px solid var(--seg-accent-border);
  margin-bottom: 32px;
}

.seg-hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--seg-accent);
  animation: seg-pulse 2s ease-in-out infinite;
}

@keyframes seg-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.seg-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--seg-text);
}

.seg-hero h1 em {
  font-style: normal;
  color: var(--seg-accent);
}

.seg-hero-subtitle {
  font-size: 1.15rem;
  color: var(--seg-text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Shield icon */
.seg-shield-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seg-accent-glow);
  border: 1px solid var(--seg-accent-border);
}

.seg-shield-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--seg-accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========================================
   SECTIONS
   ======================================== */
.seg-section {
  padding: 80px 0;
}

.seg-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--seg-accent);
  margin-bottom: 12px;
}

.seg-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
}

.seg-section-desc {
  color: var(--seg-text-secondary);
  max-width: 600px;
  font-size: 1.05rem;
  margin-bottom: 48px;
}

/* ========================================
   FLOW DIAGRAM
   ======================================== */
.seg-flow {
  position: relative;
  padding: 48px 0;
}

.seg-flow-step {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  padding-bottom: 48px;
}

.seg-flow-step:last-child {
  padding-bottom: 0;
}

.seg-flow-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.seg-flow-step:not(:last-child) .seg-flow-number::after {
  content: '';
  position: absolute;
  top: 48px;
  left: 50%;
  width: 1px;
  height: calc(100% + 0px);
  border-left: 2px dashed var(--seg-text-muted);
  opacity: 0.3;
}

.seg-flow-content {
  flex: 1;
  padding-top: 10px;
}

.seg-flow-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.seg-flow-content p {
  color: var(--seg-text-secondary);
  font-size: 0.95rem;
}

.seg-flow-step.seg-step-purple .seg-flow-number {
  background: var(--seg-purple-dim);
  color: var(--seg-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.seg-flow-step.seg-step-amber .seg-flow-number {
  background: var(--seg-amber-dim);
  color: var(--seg-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.seg-flow-step.seg-step-green .seg-flow-number {
  background: var(--seg-green-dim);
  color: var(--seg-green);
  border: 1px solid rgba(6, 214, 160, 0.25);
}

/* ========================================
   ARCHITECTURE CARDS
   ======================================== */
.seg-arch-diagram {
  background: var(--seg-bg-card);
  border: 1px solid var(--seg-border);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 40px;
  overflow: hidden;
}

.seg-arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .seg-arch-grid {
    grid-template-columns: 1fr;
  }
}

.seg-arch-card {
  background: var(--seg-bg-card);
  border: 1px solid var(--seg-border);
  border-radius: 16px;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.seg-arch-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.seg-arch-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.seg-arch-card.seg-card-coral::before { background: var(--seg-coral); }
.seg-arch-card.seg-card-blue::before { background: var(--seg-blue); }
.seg-arch-card.seg-card-green::before { background: var(--seg-accent); }

.seg-arch-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.seg-card-coral .seg-arch-card-icon { background: var(--seg-coral-dim); }
.seg-card-blue .seg-arch-card-icon { background: var(--seg-blue-dim); }
.seg-card-green .seg-arch-card-icon { background: var(--seg-green-dim); }

.seg-arch-card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seg-card-coral .seg-arch-card-icon svg { stroke: var(--seg-coral); }
.seg-card-blue .seg-arch-card-icon svg { stroke: var(--seg-blue); }
.seg-card-green .seg-arch-card-icon svg { stroke: var(--seg-accent); }

.seg-arch-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.seg-arch-card p {
  color: var(--seg-text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.seg-tech-tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.seg-card-coral .seg-tech-tag { background: var(--seg-coral-dim); color: var(--seg-coral); }
.seg-card-blue .seg-tech-tag { background: var(--seg-blue-dim); color: var(--seg-blue); }
.seg-card-green .seg-tech-tag { background: var(--seg-green-dim); color: var(--seg-accent); }

/* ========================================
   AUTHENTICATION CARDS
   ======================================== */
.seg-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .seg-auth-grid {
    grid-template-columns: 1fr;
  }
}

.seg-auth-card {
  background: var(--seg-bg-card);
  border: 1px solid var(--seg-border);
  border-radius: 16px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.seg-auth-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.seg-auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.seg-auth-google::before {
  background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05, #EA4335);
}

.seg-auth-traditional::before {
  background: var(--seg-purple);
}

.seg-auth-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.seg-auth-google .seg-auth-card-icon {
  background: rgba(66, 133, 244, 0.1);
}

.seg-auth-traditional .seg-auth-card-icon {
  background: var(--seg-purple-dim);
}

.seg-auth-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.seg-auth-card p {
  color: var(--seg-text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.seg-auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.seg-auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--seg-text-secondary);
}

.seg-auth-google .seg-auth-feature svg {
  color: #34A853;
}

.seg-auth-traditional .seg-auth-feature svg {
  color: var(--seg-purple);
}

/* ========================================
   GUARANTEES
   ======================================== */
.seg-guarantees {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 48px;
}

@media (max-width: 640px) {
  .seg-guarantees {
    grid-template-columns: 1fr;
  }
}

.seg-guarantee {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--seg-bg-card);
  border: 1px solid var(--seg-border);
}

.seg-guarantee-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--seg-green-dim);
  border: 1px solid var(--seg-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.seg-guarantee-check svg {
  width: 14px;
  height: 14px;
  stroke: var(--seg-accent);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seg-guarantee h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.seg-guarantee p {
  color: var(--seg-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* ========================================
   FAQ
   ======================================== */
.seg-faq-list {
  max-width: 700px;
}

.seg-faq-item {
  border-bottom: 1px solid var(--seg-border);
  padding: 24px 0;
}

.seg-faq-item:first-child {
  border-top: 1px solid var(--seg-border);
}

.seg-faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
  color: var(--seg-text);
}

.seg-faq-question::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--seg-text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.seg-faq-item.open .seg-faq-question::after {
  transform: rotate(45deg);
  color: var(--seg-accent);
}

.seg-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  color: var(--seg-text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
}

.seg-faq-item.open .seg-faq-answer {
  max-height: 300px;
  padding-top: 14px;
}

/* ========================================
   DIVIDER
   ======================================== */
.seg-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--seg-accent-border), transparent);
  margin: 0;
}

/* ========================================
   CTA
   ======================================== */
.seg-cta-section {
  text-align: center;
  padding: 80px 0 100px;
}

.seg-cta-box {
  background: var(--seg-bg-card);
  border: 1px solid var(--seg-accent-border);
  border-radius: 20px;
  padding: 56px 40px;
  position: relative;
  overflow: hidden;
}

.seg-cta-box::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 214, 160, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.seg-cta-box h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.seg-cta-box p {
  color: var(--seg-text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.seg-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  border-radius: 12px;
  background: var(--seg-accent);
  color: var(--seg-bg);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.seg-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(6, 214, 160, 0.25);
  color: var(--seg-bg);
  text-decoration: none;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
  .seg-hero-badge,
  .seg-hero h1,
  .seg-hero-subtitle,
  .seg-shield-icon {
    opacity: 0;
    transform: translateY(20px);
    animation: seg-fadeUp 0.6s ease forwards;
  }

  .seg-shield-icon { animation-delay: 0.1s; }
  .seg-hero-badge { animation-delay: 0.2s; }
  .seg-hero h1 { animation-delay: 0.3s; }
  .seg-hero-subtitle { animation-delay: 0.4s; }

  @keyframes seg-fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Scroll-triggered animations for page elements */
.seg-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.seg-animate.seg-visible {
  opacity: 1;
  transform: translateY(0);
}
