/* calchub.css — Tema visual do Calchub
   Paleta, tipografia e componentes.
   Totalmente responsivo. */

/* ------------------------------
   Paleta e tokens de design
------------------------------ */
:root {
  --color-bg: #f3f4f6;
  --color-bg-alt: #ffffff;
  --color-bg-soft: #e5e7eb;

  --color-primary: #2563eb;
  --color-primary-strong: #1d4ed8;
  --color-primary-soft: #dbeafe;

  --color-text-main: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;

  --color-danger: #b91c1c;
  --color-success: #15803d;
  --color-warning: #b45309;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);

  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ------------------------------
   Reset básico
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text-main);
  background: radial-gradient(circle at top left, #e0edff, #f9fafb);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ------------------------------
   Layout: páginas de autenticação
------------------------------ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.25rem 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.auth-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.auth-subtitle {
  margin: 0.35rem 0 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Mensagens */
.alert {
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf3;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

/* ------------------------------
   Formulários
------------------------------ */
.form-group {
  margin-bottom: 1.1rem;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 0.25rem;
}

.input {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  outline: none;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.input::placeholder {
  color: #9ca3af;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-strong), #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.16);
}

/* Linha de ações abaixo do form */
.auth-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

/* ------------------------------
   Layout geral da aplicação
------------------------------ */
.app-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, #bfdbfe, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 1rem;
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.app-user-name {
  font-weight: 600;
  color: var(--color-text-main);
}

.app-main {
  flex: 1;
  padding: 1.5rem;
}

.app-container {
  max-width: 1080px;
  margin: 0 auto;
}

/* Dashboard: saudação */
.app-greeting {
  margin-bottom: 1.5rem;
}

.app-greeting h1 {
  margin: 0 0 0.15rem;
  font-size: 1.4rem;
}

.app-greeting p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Cards do dashboard */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.card-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  align-self: flex-start;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

.card-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.card-actions {
  margin-top: 0.5rem;
}

/* Rodapé */
.app-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: #ffffff;
  text-align: center;
}

/* ------------------------------
   Responsividade
------------------------------ */
@media (max-width: 600px) {
  .auth-card {
    padding: 1.75rem 1.4rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .app-main {
    padding: 1.2rem 1rem 1.5rem;
  }
}
