/* Login Page — Almir Diniz Consultoria */
:root {
  --bg: #0a0a0a;
  --graphite: #131411;
  --graphite-2: #1b1c18;
  --line: rgba(201, 164, 92, 0.28);
  --line-soft: rgba(255, 255, 255, 0.12);
  --text: #f4efe4;
  --muted: #a9a496;
  --gold: #c9a45c;
  --gold-hi: #dfc07d;
  --gold-glow: rgba(201, 164, 92, 0.2);
  --error: #e63946;
  --error-bg: rgba(230, 57, 70, 0.12);
  --error-border: rgba(230, 57, 70, 0.4);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
}

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

[hidden] {
  display: none !important;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(16px, 3vh, 32px) clamp(16px, 4vw, 24px);
  background:
    radial-gradient(ellipse 65% 50% at 50% 15%, rgba(201, 164, 92, 0.14), transparent 70%),
    linear-gradient(180deg, #0e0f0c 0%, #070706 100%);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-shell {
  width: 100%;
  max-width: 440px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top bar / Back navigation */
.login-nav {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 20px;
}

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color .2s ease, background-color .2s ease;
}

.login-back:hover {
  color: var(--gold);
  background: rgba(201, 164, 92, 0.08);
}

.login-back:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Card */
.login-card {
  width: 100%;
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(24px, 5vw, 40px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Header inside card */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand {
  display: inline-block;
  line-height: 0;
  margin-bottom: 18px;
  transition: transform .25s ease;
}

.login-brand:hover {
  transform: scale(1.02);
}

.login-brand img {
  width: 195px;
  height: auto;
  display: block;
}

.login-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  background: rgba(201, 164, 92, 0.1);
  border: 1px solid rgba(201, 164, 92, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.login-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(28px, 4.2vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #dfdbcf;
}

.form-forgot {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  transition: color .2s ease;
}

.form-forgot:hover {
  color: var(--gold-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-forgot:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Input wrappers with icons */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--gold);
  opacity: 0.85;
  pointer-events: none;
  flex-shrink: 0;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  background: #0d0e0b;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  outline: none;
}

.form-input::placeholder {
  color: #726e64;
}

.form-input:hover {
  border-color: rgba(201, 164, 92, 0.4);
}

.form-input:focus {
  border-color: var(--gold);
  background: #11120e;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input.has-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.18);
}

.form-input-pass {
  padding-right: 48px;
}

/* Password toggle button */
.btn-toggle-password {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color .2s ease, background-color .2s ease;
}

.btn-toggle-password:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-toggle-password:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-toggle-password svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* Alert / Error Box */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #ffa1a9;
  text-align: left;
  animation: shake 0.35s ease;
}

.login-alert[hidden] {
  display: none !important;
}

.login-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #ff6b77;
  margin-top: 2px;
}

.login-alert p {
  margin: 0;
  color: inherit;
}

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

/* Success notification */
.login-alert-success {
  background: rgba(42, 157, 143, 0.15);
  border-color: rgba(42, 157, 143, 0.45);
  color: #72efdd;
}

.login-alert-success svg {
  color: #48cae4;
}

/* Submit Button */
.btn-login {
  position: relative;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gold);
  color: #0c0d0a;
  border: 0;
  border-radius: 8px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 24px;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn-login:hover:not(:disabled) {
  background: var(--gold-hi);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgba(201, 164, 92, 0.4);
}

.btn-login:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-login:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.btn-arrow {
  display: inline-block;
  transition: transform .25s ease;
  font-size: 16px;
  line-height: 1;
}

.btn-login:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(12, 13, 10, 0.25);
  border-top-color: #0c0d0a;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
}

.spinner[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Security notice */
.login-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #8c887d;
}

.login-security-notice svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  opacity: 0.8;
}

/* Card footer */
.login-card-footer {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.login-card-footer a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}

.login-card-footer a:hover {
  color: var(--gold-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-card-footer a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Page footer */
.login-page-footer {
  width: 100%;
  max-width: 440px;
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #706c62;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.login-page-footer a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.login-page-footer a:hover {
  color: var(--muted);
}

@media (max-width: 480px) {
  body.login-page {
    padding: 14px 12px;
  }
  .login-card {
    padding: 24px 18px;
    border-radius: 12px;
  }
  .login-brand img {
    width: 165px;
  }
}
