@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Tesserax Identity Palette */
  --accent: #ff6b00; /* Laranja Tesserax */
  --accent-hover: #e56000;
  --accent-light: rgba(255, 107, 0, 0.12);
  --accent-glow: rgba(255, 107, 0, 0.3);

  /* Dark theme (Preto) */
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #171717;
  --bg-input: #1a1a1a;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Borders */
  --border: #27272a;
  --border-light: rgba(255, 107, 0, 0.3); /* Borda laranjada sutil */
  --border-active: #ff6b00;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 25px rgba(255, 107, 0, 0.2);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent-hover);
}

/* ==================== AUTH LAYOUT ==================== */
.auth-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--border-active);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.auth-header-flex .arrow {
  color: var(--text-muted);
  font-size: 18px;
  opacity: 0.5;
}

.auth-logo .logo-box {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1f1f1f, #0a0a0a);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: var(--shadow-sm);
}

.auth-logo .logo-box.tesserax-box {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.auth-logo .logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.15); /* Zoom ajustado para não vazar a caixa */
}

.auth-logo .logo-icon {
  margin: 0;
}

.auth-logo h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-logo p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.error-box {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 20px;
  display: none; /* Controlled by JS */
}

/* ==================== ROLE SELECTOR ==================== */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.role-option {
  padding: 16px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.role-option:hover {
  border-color: var(--accent);
}

.role-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.role-option .role-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.role-option .role-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.role-option .role-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #ff8a00, var(--accent));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(255, 107, 0, 0.4);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== FOOTER ==================== */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
/* ==================== ANIMATIONS ==================== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes dissolveOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    filter: blur(8px);
  }
}

.dissolve-out {
  animation: dissolveOut 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}
