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

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

:root {
  --brand:   #E8601C;
  --muted:   rgba(255,255,255,.5);
  --border:  rgba(255,255,255,.1);
  --input-h: 50px;
  --trans:   .2s ease;
}

html, body {
  height: 100%;
  font-family: 'Ubuntu', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
input, textarea, [contenteditable] {
  user-select: text;
}

body {
  min-height: 100vh;
  background: #050d1a;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url('https://images.pexels.com/photos/36732143/pexels-photo-36732143.jpeg');
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background: rgba(4, 8, 20, 0.62);
  pointer-events: none;
  z-index: 0;
}

/* ── Per-portal tint (differentiates candidato/admin/empregador at a glance) ── */
body.theme-admin::after      { background: rgba(28, 10, 8, 0.68); }
body.theme-empregador::after { background: rgba(5, 26, 16, 0.68); }

body.theme-admin .deco-1, body.theme-admin .deco-2 {
  background: radial-gradient(circle, rgba(220,38,38,.22) 0%, transparent 65%);
}
body.theme-empregador .deco-1, body.theme-empregador .deco-2 {
  background: radial-gradient(circle, rgba(22,163,74,.22) 0%, transparent 65%);
}

/* ── Portal badge (small label above the form heading) ── */
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  background: rgba(232,96,28,.15);
  color: var(--brand);
  border: 1px solid rgba(232,96,28,.3);
}
body.theme-admin .portal-badge {
  background: rgba(220,38,38,.15);
  color: #f87171;
  border-color: rgba(220,38,38,.3);
}
body.theme-empregador .portal-badge {
  background: rgba(22,163,74,.15);
  color: #4ade80;
  border-color: rgba(22,163,74,.3);
}

/* Empregador uses green instead of the global orange brand for focus/submit states */
body.theme-empregador { --brand: #16a34a; }
body.theme-empregador input:focus {
  border-color: rgba(22,163,74,.65);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
body.theme-empregador .btn-submit {
  background: linear-gradient(135deg, #16a34a 0%, #0f7a37 100%);
  box-shadow: 0 4px 20px rgba(22,163,74,.4);
}
body.theme-empregador .btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #22c55e 0%, #128a40 100%);
  box-shadow: 0 6px 28px rgba(22,163,74,.55);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ── Card base (frosted glass) ── */
.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ── Single-card layout (login.php unified) ── */
.card:not(:has(.panel-left)) {
  max-width: 440px;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
}

/* center brand in single-card */
.card:not(:has(.panel-left)) .brand {
  align-items: center;
  margin-bottom: 24px;
}

/* ── Two-panel layout (admin / candidato / empregador) ── */
.card:has(.panel-left) {
  display: flex;
  max-width: 820px;
}

/* ── Left panel ── */
.panel-left {
  flex: 0 0 310px;
  padding: 52px 40px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* decorative glow blobs */
.deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.deco-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(232,96,28,.22) 0%, transparent 65%);
  top: -90px; right: -90px;
}
.deco-2 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(232,96,28,.12) 0%, transparent 65%);
  bottom: 20px; left: -55px;
}
.deco-3 {
  width: 70px; height: 70px;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
  bottom: 130px; right: 28px;
}

/* ── Right panel ── */
.panel-right {
  flex: 1;
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
}

/* ── Logo / brand ── */
.brand { display: flex; flex-direction: column; }

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
}

.logo-icon {
  background: #2a2a2a;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-icon img { width: 44px; height: 44px; object-fit: cover; display: block; }

.logo-name {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1.5px;
}
.logo-name span { color: var(--brand); }

/* Left panel heading */
.panel-title {
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -.2px;
}
.panel-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-top: 10px;
}

/* ── Secure badge (small icon-in-orange-square + light text) ── */
.badge-secure {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
}
.badge-secure svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  padding: 7px;
  box-sizing: content-box;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
}

/* ── Form header ── */
.form-header { margin-bottom: 26px; }
.form-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}
.form-header p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Role tabs ── */
.role-tabs {
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 26px;
}
.role-tab {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 9px;
  background: none;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
}
.role-tab:hover:not(.active) { color: rgba(255,255,255,.75); }
.role-tab.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232,96,28,.45);
}

/* ── Form fields ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  margin-bottom: 8px;
  letter-spacing: .3px;
}

.input-wrap { position: relative; }
.input-wrap svg.input-icon {
  position: absolute;
  left: 14px;
  top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  color: rgba(255,255,255,.25);
  pointer-events: none;
  transition: color var(--trans);
}
.input-wrap:focus-within svg.input-icon { color: var(--brand); }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: var(--input-h);
  padding: 0 42px 0 40px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  outline: none;
  transition: border-color var(--trans), background var(--trans), box-shadow var(--trans);
}
input::placeholder { color: rgba(255,255,255,.22); }
input:focus {
  border-color: rgba(232,96,28,.65);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(232,96,28,.12);
}

.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.25); padding: 4px;
  display: flex; transition: color var(--trans);
}
.toggle-pass:hover { color: rgba(255,255,255,.65); }
.toggle-pass svg { width: 15px; height: 15px; }

/* ── Error box ── */
.error-box {
  display: none; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.22);
  border-radius: 8px;
  font-size: 13px; color: #fca5a5;
  margin-bottom: 16px;
  animation: shake .35s ease;
}
.error-box.show { display: flex; }
.error-box svg { width: 14px; height: 14px; flex-shrink: 0; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ── Submit button ── */
.btn-submit {
  width: 100%; height: 50px;
  background: linear-gradient(135deg, #E8601C 0%, #c44f10 100%);
  color: #fff; border: none;
  border-radius: 10px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--trans);
  box-shadow: 0 4px 20px rgba(232,96,28,.4);
  margin-bottom: 16px;
}
.btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #f06828 0%, #d55510 100%);
  box-shadow: 0 6px 28px rgba(232,96,28,.55);
  transform: translateY(-1px);
}
.btn-submit:active   { transform: translateY(0); }
.btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Spinner ── */
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Links ── */
.form-links { display: flex; justify-content: center; }
.form-links a {
  font-size: 13px; color: rgba(255,255,255,.5);
  text-decoration: none; font-weight: 400;
  transition: color var(--trans);
}
.form-links a:hover { color: #fff; }

/* ── Divider ── */
.divider {
  width: 100%; height: 1px;
  background: rgba(255,255,255,.07);
  margin: 20px 0;
}

/* ── Forgot panel ── */
#esqueciPanel {
  display: none;
  margin-top: 16px;
  padding: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
}
#esqueciPanel p { color: rgba(255,255,255,.65); font-size: 13px; }

/* ── Info box ── */
.info-box {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 16px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  line-height: 1.65;
}
.info-box svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; color: rgba(255,255,255,.3); }
.info-box strong { color: rgba(255,255,255,.75); }

/* ── Success banner ── */
.success-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(52,211,153,.11);
  border: 1px solid rgba(52,211,153,.22);
  border-radius: 8px;
  font-size: 13px; color: #6ee7b7;
  margin-bottom: 18px;
}
.success-banner svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Footer ── */
.card-footer {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,.28);
  line-height: 1.9;
  margin-top: auto;
  padding-top: 4px;
}
.card-footer a { color: rgba(255,255,255,.4); text-decoration: underline; }
.card-footer a:hover { color: rgba(255,255,255,.7); }

/* ── Responsive ── */
@media (max-width: 700px) {
  .card:has(.panel-left) { flex-direction: column; max-width: 460px; }
  .panel-left {
    flex: none;
    padding: 36px 32px 28px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  .panel-right { padding: 32px; }
  .logo { margin-bottom: 16px; }
  .panel-title { font-size: 21px; }
}
@media (max-width: 480px) {
  .card:not(:has(.panel-left)) { padding: 36px 28px; }
  .panel-left { padding: 28px 24px 22px; }
  .panel-right { padding: 24px; }
}
