/* ============================================================
   PIN — Login Page Styles
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --clr-primary:       #6C63FF;
  --clr-primary-dark:  #574FD6;
  --clr-primary-glow:  rgba(108, 99, 255, 0.35);
  --clr-bg:            #0D0E1C;
  --clr-surface:       #13152A;
  --clr-surface-alt:   #1A1D35;
  --clr-border:        rgba(255, 255, 255, 0.08);
  --clr-border-focus:  rgba(108, 99, 255, 0.6);
  --clr-text:          #E8E9F3;
  --clr-text-muted:    #7E82A4;
  --clr-error:         #FF6B6B;
  --clr-error-bg:      rgba(255, 107, 107, 0.1);
  --clr-success:       #4ECDC4;
  --radius-card:       20px;
  --radius-input:      12px;
  --shadow-card:       0 32px 64px rgba(0, 0, 0, 0.5);
  --transition:        0.25s ease;
  --font:              'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

/* ---------- Background Shapes ---------- */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: float 10s ease-in-out infinite alternate;
}

.shape-1 {
  width: 480px;
  height: 480px;
  background: var(--clr-primary);
  top: -120px;
  left: -120px;
  animation-duration: 12s;
}

.shape-2 {
  width: 360px;
  height: 360px;
  background: #A78BFA;
  bottom: -80px;
  right: -80px;
  animation-duration: 9s;
  animation-delay: -3s;
}

.shape-3 {
  width: 260px;
  height: 260px;
  background: #60A5FA;
  top: 50%;
  left: 55%;
  animation-duration: 15s;
  animation-delay: -6s;
}

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ---------- Layout ---------- */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Card ---------- */
.login-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(16px);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--clr-primary), #A78BFA);
  color: #fff;
  box-shadow: 0 4px 16px var(--clr-primary-glow);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #fff 30%, #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Card Header ---------- */
.card-header {
  margin-bottom: 28px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.2;
}

.card-subtitle {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--clr-text-muted);
  font-weight: 400;
}

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

/* Field Group */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--clr-text-muted);
  text-transform: uppercase;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition);
}

.field-input {
  width: 100%;
  background: var(--clr-surface-alt);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-input);
  color: var(--clr-text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 13px 44px 13px 44px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.field-input::placeholder {
  color: rgba(126, 130, 164, 0.5);
}

.field-input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.field-input:focus {
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.18);
  background: #1E2240;
}

/* Ícone muda cor no foco */
.field-group:focus-within .input-icon {
  color: var(--clr-primary);
}

/* Toggle senha */
.toggle-pass {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition);
}

.toggle-pass:hover {
  color: var(--clr-text);
}

/* Ajuste padding quando tem botão de visibilidade */
#password {
  padding-right: 48px;
}

/* Erro */
.field-error {
  font-size: 0.78rem;
  color: var(--clr-error);
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 4px;
  padding-left: 2px;
}

/* Estado de erro no grupo */
.field-group.has-error .field-input {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px var(--clr-error-bg);
}

.field-group.has-error .field-error {
  display: flex;
}

.field-group.has-error .input-icon {
  color: var(--clr-error);
}

/* ---------- Form Options (lembrar / esqueci) ---------- */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

/* Checkbox customizado */
.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--clr-border);
  border-radius: 5px;
  background: var(--clr-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s ease;
  margin-top: -2px;
}

.remember-label input:checked + .checkmark {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}

.remember-label input:checked + .checkmark::after {
  transform: rotate(45deg) scale(1);
}

.forgot-link {
  font-size: 0.85rem;
  color: var(--clr-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: #A78BFA;
  text-decoration: underline;
}

/* ---------- Erro global do formulário ---------- */
.form-error-msg {
  display: none;
  background: var(--clr-error-bg);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: var(--radius-input);
  color: var(--clr-error);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 14px;
  text-align: center;
  animation: slideUp 0.2s ease both;
}

/* ---------- Botão Entrar ---------- */
.btn-enter {
  margin-top: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-input);
  background: linear-gradient(135deg, var(--clr-primary) 0%, #A78BFA 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--clr-primary-glow);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
  overflow: hidden;
}

.btn-enter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition);
}

.btn-enter:hover::before {
  background: rgba(255, 255, 255, 0.08);
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--clr-primary-glow);
}

.btn-enter:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px var(--clr-primary-glow);
}

.btn-enter:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Loader do botão */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: none;
  flex-shrink: 0;
}

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

/* Estado loading */
.btn-enter.is-loading .btn-text {
  opacity: 0.6;
}

.btn-enter.is-loading .btn-loader {
  display: inline-block;
}

/* ---------- Card Footer ---------- */
.card-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
}

.link-signup {
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  transition: color var(--transition);
}

.link-signup:hover {
  color: #A78BFA;
  text-decoration: underline;
}

/* ---------- Powered By ---------- */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--clr-border);
}

.powered-text {
  font-size: 0.72rem;
  color: var(--clr-text-muted);
  font-weight: 400;
  opacity: 0.7;
}

.powered-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  opacity: 0.75;
  filter: brightness(1.1);
}

.powered-brand {
  font-size: 0.72rem;
  color: var(--clr-text-muted);
  font-weight: 600;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 1.3rem;
  }
}
