import 'package:flutter/material.dart';
import '../colors/app_colors.dart';
import '../strings/terms_strings.dart';

const Color kTermsPink = AppColors.pink;

/// Emblema circular rosa + título "Termos e Condições", reutilizado nos
/// dois ecrãs que mostram este conteúdo.
class TermsHeader extends StatelessWidget {
  const TermsHeader({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          width: 76,
          height: 76,
          decoration: BoxDecoration(
            color: kTermsPink.withValues(alpha: 0.12),
            shape: BoxShape.circle,
          ),
          child: const Icon(
            Icons.gavel_rounded,
            color: kTermsPink,
            size: 36,
          ),
        ),
        const SizedBox(height: 16),
        const Text(
          TermsStrings.headerTitle,
          textAlign: TextAlign.center,
          style: TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.w900,
            color: Colors.black,
          ),
        ),
      ],
    );
  }
}

/// Corpo de texto dos Termos, dentro de um cartão branco.
class TermsBody extends StatelessWidget {
  const TermsBody({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(18),
      decoration: BoxDecoration(
        color: Colors.white.withValues(alpha: 0.9),
        borderRadius: BorderRadius.circular(20),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withValues(alpha: 0.05),
            blurRadius: 14,
            offset: const Offset(0, 6),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          for (var i = 0; i < TermsStrings.paragraphs.length; i++) ...[
            if (i > 0) const SizedBox(height: 14),
            Text(
              TermsStrings.paragraphs[i],
              textAlign: TextAlign.center,
              style: TextStyle(
                fontSize: 13,
                fontWeight: FontWeight.w600,
                height: 1.5,
                color: Colors.black.withValues(alpha: 0.78),
              ),
            ),
          ],
        ],
      ),
    );
  }
}
