:root {
  --bg: linear-gradient(135deg, #e0e7ff, #f0f4ff);
  --card: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --muted: #6b7280;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
  --glass: rgba(255, 255, 255, 0.65);
}

* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: fadeIn 0.5s ease-in;
}

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

/* === CARD PRINCIPAL === */
.card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  width: 100%;
  max-width: 500px;
  animation: slideUp 0.4s ease-out;
}

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

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

h1 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 24px;
}

.lead {
  font-size: 13px;
  color: var(--muted);
}

/* === CAMPOS === */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.field.has-icon {
  display: flex;
  align-items: center;
}

.field.has-icon .icon {
  position: absolute;
  left: 5px;
  top: 45%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--accent-dark);
  opacity: 0.75;
}

.field.has-icon label {
  left: 24px;
}

/* === INPUTS === */
.input {
  width: 100%;
  padding: 14px 42px 14px 40px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.85);
  transition: all var(--transition);
  margin-bottom: 10px;
  display: block;
  line-height: 1.4;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  background: white;
}

/* === LABEL FLUTUANTE === */
label {
  position: absolute;
  top: 45%;
  left: 28px;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  padding: 0 6px;
  transition: all var(--transition);
  font-size: 14px;
  pointer-events: none;
}

.input:focus + label,
.input:not(:placeholder-shown) + label, 
.input.input-autofilled + label {
  top: -4px;
  font-size: 14px;
  color: var(--accent-dark);
  background: white;
  padding: 0 6px;
  border-radius: 4px;
}

/* === PLACEHOLDER CENTRALIZADO === */
.input::placeholder {
  color: var(--muted);
  padding-left: 10px;
  margin-left: 4px;
  line-height: 1.4;
  vertical-align: middle;
}

/* === BOTÃO DE MOSTRAR SENHA === */
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 45%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}

.pw-toggle:hover {
  color: var(--accent-dark);
  background: rgba(37, 99, 235, 0.1);
}

/* === BOTÃO PRINCIPAL === */
.btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: white;
  font-weight: 600;
  padding: 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn:active {
  transform: scale(0.98);
}

/* === MENSAGEM === */
#loginMessage {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 18px;
}

/* === RESPONSIVO === */
@media (max-width: 600px) {
  .card {
    padding: 28px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: 20px;
  }

  .input {
    font-size: 14px;
  }
}

/* === AUTOFILL CORREÇÃO === */
input:-webkit-autofill {
  background-color: rgba(231, 247, 144, 0.85) !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.85) inset !important;
  -webkit-text-fill-color: #222 !important;
  caret-color: #222;
  transition: background-color 5000s ease-in-out 0s;
}

input:-webkit-autofill::first-line {
  font-size: 15px;
}
