/* ============================================================
   assets/css/main.css — Estilos globais do portal
   ============================================================ */

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

:root {
  --primary:      #1F4E79;
  --primary-mid:  #2E75B6;
  --primary-lite: #DEEAF1;
  --green:        #2E7D32;
  --green-lite:   #E8F5E9;
  --orange:       #E65100;
  --orange-lite:  #FFF3E0;
  --red:          #C62828;
  --red-lite:     #FFEBEE;
  --gray:         #F5F5F5;
  --gray-mid:     #888;
  --gray-dark:    #333;
  --white:        #fff;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --radius:       8px;
  --radius-lg:    12px;
  --font:         'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--gray-dark);
  background: #F8F9FA;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- HEADER ---- */
.header {
  background: var(--white);
  border-bottom: 1px solid #E0E0E0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.logo-icon { font-size: 22px; }

.header-search { flex: 1; max-width: 300px; }

.search-form-mini {
  display: flex;
  gap: 6px;
  align-items: center;
}

.select-mini {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #DDD;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-dark);
}

.btn-search-mini {
  padding: 7px 12px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}

.btn-search-mini:hover { background: var(--primary-mid); }

.nav { display: flex; gap: 4px; }

.nav-link {
  padding: 8px 12px;
  text-decoration: none;
  color: var(--gray-dark);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}

.nav-link:hover { background: var(--gray); color: var(--primary); }

.header-auth { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.lang-selector { display: flex; gap: 2px; }

.lang-btn {
  padding: 4px 6px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 16px;
  opacity: .5;
  transition: opacity .2s;
}

.lang-btn:hover, .lang-btn.active { opacity: 1; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary  { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-mid); }

.btn-green    { background: var(--green); color: var(--white); }
.btn-green:hover { background: #1B5E20; }

.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-lite); }

.btn-ghost    { background: transparent; color: var(--gray-mid); }
.btn-ghost:hover { background: var(--gray); }

.btn-danger   { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #B71C1C; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #EEE;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-body { padding: 20px; }

/* ---- VAGA CARD ---- */
.job-card {
  background: var(--white);
  border: 1px solid #E8E8E8;
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card:hover {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.job-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.job-card-company { font-size: 14px; color: var(--gray-mid); }

.job-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-province { background: var(--primary-lite); color: var(--primary); }
.tag-salary   { background: var(--green-lite);   color: var(--green); }
.tag-japanese { background: var(--orange-lite);  color: var(--orange); }
.tag-status   { background: var(--green-lite);   color: var(--green); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #DDD;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  transition: border .2s;
  background: var(--white);
  color: var(--gray-dark);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(46,117,182,.12);
}

.form-select { appearance: none; 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='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}

.form-hint { font-size: 12px; color: var(--gray-mid); margin-top: 4px; }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: var(--green-lite);   color: var(--green); border: 1px solid #A5D6A7; }
.alert-error   { background: var(--red-lite);     color: var(--red);   border: 1px solid #EF9A9A; }
.alert-info    { background: var(--primary-lite);  color: var(--primary); border: 1px solid #90CAF9; }
.alert-warning { background: var(--orange-lite);  color: var(--orange); border: 1px solid #FFCC80; }

/* ---- GRID ---- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: var(--green-lite); color: var(--green); }
.badge-blue   { background: var(--primary-lite); color: var(--primary); }
.badge-orange { background: var(--orange-lite); color: var(--orange); }
.badge-red    { background: var(--red-lite); color: var(--red); }
.badge-gray   { background: var(--gray); color: var(--gray-mid); }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 14px; background: var(--primary); color: var(--white); text-align: left; font-weight: 500; font-size: 13px; }
td { padding: 10px 14px; border-bottom: 1px solid #EEE; vertical-align: middle; }
tr:hover td { background: #FAFAFA; }

/* ---- SIDEBAR LAYOUT ---- */
.layout-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 24px 0;
}

.sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 8px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-decoration: none;
  color: var(--gray-dark);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all .2s;
}

.sidebar-link:hover { background: var(--gray); }
.sidebar-link.active { background: var(--primary-lite); color: var(--primary); font-weight: 500; }

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--gray-mid); margin-top: 4px; }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: var(--white);
  padding: 60px 20px;
  text-align: center;
}

.hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.hero p  { font-size: 18px; opacity: .85; margin-bottom: 32px; }

.hero-search {
  display: flex;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-search select,
.hero-search input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
}

/* ---- FOOTER ---- */
footer {
  background: var(--primary);
  color: rgba(255,255,255,.8);
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-title { color: var(--white); font-weight: 600; margin-bottom: 12px; }
.footer-link  { color: rgba(255,255,255,.7); text-decoration: none; display: block; margin-bottom: 6px; font-size: 14px; transition: color .2s; }
.footer-link:hover { color: var(--white); }

/* ---- MOBILE MENU ---- */
.mobile-nav {
  display: none !important;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 99;
  padding: 20px;
  overflow-y: auto;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #EEE;
  box-shadow: var(--shadow-md);
}

.mobile-nav.aberto { display: flex !important; }

.mobile-nav a {
  display: block;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--gray-dark);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  transition: background .2s;
}

.mobile-nav a:hover    { background: var(--gray); }
.mobile-nav .divider   { height: 1px; background: #EEE; margin: 8px 0; }
.mobile-nav .lang-row  { display: flex; gap: 8px; padding: 8px 16px; flex-wrap: wrap; }
.mobile-nav .lang-row a { padding: 6px 10px; font-size: 20px; }

/* ---- MEDIA QUERIES ---- */
@media (max-width: 900px) {
  .header-search { display: none; }
}

@media (max-width: 768px) {
  /* Header */
  .nav          { display: none; }
  .header-auth  { display: none; }
  .menu-toggle  { display: block; margin-left: auto; }
  .mobile-nav   { display: none !important; }
  .mobile-nav.aberto { display: flex !important; }
  .header-inner { gap: 12px; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Sidebar layout */
  .layout-sidebar { grid-template-columns: 1fr; gap: 16px; }
  .sidebar { position: static; }

  /* Hero */
  .hero         { padding: 40px 16px; }
  .hero h1      { font-size: 24px; }
  .hero p       { font-size: 15px; }
  .hero-search  { flex-direction: column; gap: 8px; }
  .hero-search select,
  .hero-search input { min-width: unset; width: 100%; }

  /* Cards */
  .card-header  { font-size: 14px; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body    { padding: 16px; }

  /* Footer */
  .footer-grid  { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Forms: grid 2 cols → 1 col */
  .card-body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tabela scroll horizontal */
  .table-wrap   { -webkit-overflow-scrolling: touch; }

  /* Botoes menores */
  .btn-lg       { padding: 11px 20px; font-size: 15px; }

  /* Stat cards */
  .stat-value   { font-size: 26px; }
}

@media (max-width: 480px) {
  .footer-grid  { grid-template-columns: 1fr; }
  .container    { padding: 0 14px; }
  .hero h1      { font-size: 20px; }
  .job-card     { padding: 14px; }

  /* Formularios ocupam tela toda */
  .card         { border-radius: var(--radius); }
}

/* ---- JS: toggleMenu ---- */