/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #00c853;
  --green-dark:   #009624;
  --green-glow:   rgba(0, 200, 83, 0.25);
  --gold:         #ffd600;
  --dark:         #0a0f0a;
  --dark-2:       #111a11;
  --card-bg:      rgba(15, 24, 15, 0.92);
  --card-border:  rgba(0, 200, 83, 0.18);
  --input-bg:     rgba(255,255,255,0.05);
  --input-border: rgba(255,255,255,0.12);
  --input-focus:  rgba(0, 200, 83, 0.5);
  --text:         #e8f5e9;
  --text-muted:   rgba(232, 245, 233, 0.5);
  --error:        #ff5252;
  --error-bg:     rgba(255, 82, 82, 0.1);
  --radius:       14px;
  --transition:   0.25s ease;
}

html {
  overflow-y: scroll;
}

html, body {
  min-height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--dark);
  color: var(--text);
}

/* ===== LAYOUT ===== */
.login-wrapper {
  position: relative;
  display: block;
  width: 100%;
  min-height: 100vh;
  padding: 40px 24px;
}

.login-wrapper > .login-card {
  margin: 0 auto;
}

/* ===== BACKGROUND ===== */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-field {
  position: absolute;
  inset: 0;
  background-image: url('../imagens/bg-login.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-field::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 30, 10, 0.82) 0%,
    rgba(0, 80, 30, 0.65) 50%,
    rgba(0, 30, 10, 0.85) 100%
  );
}

/* ===== CARD ===== */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 48px 40px 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(0,200,83,0.08),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 80px var(--green-glow);
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== LOGO ===== */
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.logo-copa-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0,200,83,0.4));
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green);
}

/* ===== HEADER ===== */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== FORM ===== */
#cadastro-form, #login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
  flex-shrink: 0;
}

.input-wrapper:focus-within .input-icon { color: var(--green); }

.input-wrapper input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrapper input::placeholder { color: rgba(232, 245, 233, 0.25); }

.input-wrapper input:focus {
  border-color: var(--input-focus);
  background: rgba(0,200,83,0.05);
  box-shadow: 0 0 0 3px rgba(0,200,83,0.08);
}

.input-wrapper input[type="password"] { padding-right: 44px; }

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--green); }
.eye-icon { width: 17px; height: 17px; }

/* ===== ERROR ===== */
.login-error {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--error-bg);
  border: 1px solid rgba(255,82,82,0.25);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 13.5px;
  animation: shake 0.4s ease;
}

.login-error svg { width: 16px; height: 16px; flex-shrink: 0; }
.login-error.visible { display: flex; }

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

/* ===== BUTTON ===== */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(0,200,83,0.35);
}

.btn-login:hover  { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 28px rgba(0,200,83,0.45); }
.btn-login:active { transform: translateY(0); opacity: 1; }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.spinner {
  width: 18px;
  height: 18px;
  animation: rotate 0.9s linear infinite;
}

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

/* ===== FOOTER ===== */
.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-footer p { font-size: 13px; color: var(--text-muted); }
.login-footer a  { color: var(--green); text-decoration: none; font-weight: 600; }
.login-footer a:hover { text-decoration: underline; }

/* ===== SUCCESS STATE (cadastro) ===== */
.cadastro-success {
  text-align: center;
  padding: 8px 0 16px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: rgba(0,200,83,0.15);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--green);
  margin: 0 auto 20px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.cadastro-success h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.cadastro-success p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
