/* ============================================================
   Agzos Strategy — Anysite Design System
   Tokens, layout responsivo, partículas, animações premium
   ============================================================ */

/* --- Google Fonts: Figtree --- */
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* --- Design Tokens --- */
:root {
  /* Cores Agzos */
  --agzos-black:      #0E0E0E;
  --agzos-red:        #D10A11;
  --agzos-red-dark:   #a00810;
  --agzos-red-glow:   rgba(209, 10, 17, 0.25);

  /* Superfícies */
  --bg:               #0a0a0b;
  --bg-2:             #111114;
  --card:             #16161a;
  --card-hover:       #1c1c22;
  --border:           rgba(255,255,255,0.07);
  --border-accent:    rgba(209,10,17,0.35);
  --glass:            rgba(22,22,26,0.75);

  /* Tipografia */
  --text:             #f0f0f4;
  --text-2:           #a8a8b8;
  --text-3:           #5c5c70;

  /* Fontes */
  --font-body:        'Figtree', system-ui, -apple-system, sans-serif;
  --font-display:     'Figtree', system-ui, sans-serif;

  /* Espaçamentos */
  --radius-sm:        8px;
  --radius-md:        14px;
  --radius-lg:        20px;
  --radius-xl:        28px;

  /* Sombras */
  --shadow-card:      0 4px 24px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-btn:       0 2px 16px rgba(209,10,17,0.35);
  --shadow-glow:      0 0 40px rgba(209,10,17,0.15);

  /* Transições */
  --ease:             cubic-bezier(0.22, 1, 0.36, 1);
  --dur:              0.28s;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Canvas de Partículas --- */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* --- Layout Principal --- */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}

@media (min-width: 768px) {
  .wrap {
    max-width: 680px;
    padding: 2.5rem 2rem 4rem;
  }
}

@media (min-width: 1024px) {
  .wrap {
    max-width: 780px;
  }
}

/* --- Header --- */
.site-header {
  padding: 1.75rem 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header-logo svg,
.header-logo img {
  height: 36px;
  width: auto;
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-brand .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.header-brand .brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--agzos-red);
}

.header-divider {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-accent) 0%, transparent 100%);
  margin-left: 1rem;
}

@media (min-width: 768px) {
  .site-header {
    padding: 2.25rem 2rem 0;
  }
  .header-logo svg,
  .header-logo img {
    height: 44px;
  }
  .header-brand .brand-name {
    font-size: 1.6rem;
  }
}

/* --- Tagline --- */
.tagline {
  font-size: 0.82rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin: 0.5rem 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tagline::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--agzos-red);
  border-radius: 2px;
  flex-shrink: 0;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(209,10,17,0.4), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 .card-icon {
  width: 20px;
  height: 20px;
  background: var(--agzos-red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card h2 .card-icon svg {
  width: 11px;
  height: 11px;
  fill: #fff;
}

@media (min-width: 768px) {
  .card {
    padding: 1.75rem 2rem;
  }
}

/* --- Hint / Muted text --- */
.hint {
  color: var(--text-2);
  font-size: 0.83rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* --- Labels --- */
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 1rem 0 0.4rem;
}

label:first-child { margin-top: 0; }

/* --- Inputs & Selects --- */
input[type="url"],
input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  outline: none;
  -webkit-appearance: none;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--agzos-red);
  box-shadow: 0 0 0 3px var(--agzos-red-glow);
}

input::placeholder { color: var(--text-3); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235c5c70' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* --- Row (input + button) --- */
.row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.row input { flex: 1; margin: 0; }
.row button { flex-shrink: 0; margin: 0; width: auto; }

/* --- Botões --- */
button, .btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 0.12s var(--ease);
  outline: none;
}

button:focus-visible, .btn:focus-visible {
  box-shadow: 0 0 0 3px var(--agzos-red-glow);
}

button.primary, .btn {
  background: var(--agzos-red);
  color: #fff;
  width: 100%;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}

button.primary::after, .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

button.primary:hover, .btn:hover {
  background: var(--agzos-red-dark);
  box-shadow: 0 4px 24px rgba(209,10,17,0.5);
  transform: translateY(-1px);
}

button.primary:active, .btn:active {
  transform: translateY(0);
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  width: auto;
  padding: 0.7rem 1rem;
}

button.secondary:hover {
  border-color: var(--border-accent);
  background: rgba(209,10,17,0.06);
}

button.link {
  background: none;
  color: var(--text-3);
  width: auto;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0;
}

button.link:hover { color: var(--text-2); }

/* --- Radio Row --- */
.radio-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.radio-row label:has(input:checked) { color: var(--text); }

.radio-row input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--agzos-red);
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Progress Bar --- */
.progress {
  height: 4px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0 0.5rem;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--agzos-red), #ff4d53);
  border-radius: 4px;
  transition: width 0.4s var(--ease);
  box-shadow: 0 0 8px rgba(209,10,17,0.6);
}

/* --- Status text --- */
#status-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-2);
  min-height: 1.4em;
}

/* --- Badge de status --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.2);
}

.status-badge.offline {
  background: rgba(209,10,17,0.12);
  color: var(--agzos-red);
  border-color: rgba(209,10,17,0.2);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

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

/* --- Download link --- */
a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  text-decoration: none;
  margin-top: 1rem;
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

.footer-credit {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-credit a {
  color: var(--agzos-red);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--dur) var(--ease);
}

.footer-credit a:hover { opacity: 0.8; }

.footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Utilitários --- */
.hidden { display: none !important; }

code {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 0.82em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--agzos-red);
}

/* --- Animação de entrada dos cards --- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fade-up 0.45s var(--ease) both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }

/* --- Linha decorativa vermelha no topo da página --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--agzos-red) 40%, var(--agzos-red) 60%, transparent 100%);
  z-index: 100;
}

/* --- Responsividade: layout duas colunas em desktop --- */
@media (min-width: 900px) {
  .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
  }

  .two-col .card { margin-bottom: 0; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #particles-canvas { display: none; }
}
