/* ══════════════════════════════════════════════════════════════════════════
  Transpare Gestão Condominial — Main Stylesheet
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Custom Properties ────────────────────────────────────────────────── */
:root {
  --clr-primary:        #16d8c3;
  --clr-primary-dark:   #0ca094;
  --clr-primary-light:  #4ffff0;
  --clr-primary-glow:   rgba(22, 216, 195, 0.18);
  --clr-dark:           #081722;
  --clr-text:           #1e293b;
  --clr-text-muted:     #64748b;
  --clr-border:         #e2e8f0;
  --clr-border-focus:   #a5b4fc;
  --clr-bg:             #f8fafc;
  --clr-white:          #ffffff;
  --clr-error:          #ef4444;
  --clr-error-bg:       #fef2f2;
  --clr-error-border:   rgba(239, 68, 68, 0.25);
  --clr-success:        #22c55e;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.14);
  --shadow-btn: 0 4px 16px rgba(26,86,219,.38);
  --shadow-btn-hover: 0 6px 22px rgba(26,86,219,.50);

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  24px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur:  .2s;
}

/* ── 2. Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
  overflow: hidden;
}
body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--clr-primary-dark); text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
img, svg { display: block; }
input, button, select, textarea { font-family: inherit; }

/* ── 3. Layout Principal ─────────────────────────────────────────────────── */
.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  background: #07131c;
  overflow: hidden;
}

/* ── 4. Painel Esquerdo — Cityscape ─────────────────────────────────────── */
.panel--left {
  flex: 0 0 58%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.cityscape-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: #07131c url('../imagens/transpare-fundo-animado-web.webp') center center / cover no-repeat;
}

/* ── 5. Brand Overlay ────────────────────────────────────────────────────── */
.panel-brand {
  display: none;
}

/* ── 6. Painel Direito — Login ───────────────────────────────────────────── */
.panel--right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  overflow: hidden;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Mobile-only logo */
.mobile-logo {
  display: none;
  align-items: center;
  margin-bottom: 12px;
}

.mobile-logo img {
  width: min(230px, 100%);
}

/* ── 7. Login Card ───────────────────────────────────────────────────────── */
.login-card__header {
  margin-bottom: 14px;
}
.login-card__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.025em;
  margin-bottom: 4px;
  line-height: 1.2;
}
.login-card__header p {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.35;
}

/* ── 8. Alerta ───────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert--error {
  background: var(--clr-error-bg);
  color: var(--clr-error);
  border: 1px solid var(--clr-error-border);
}

/* ── 9. Formulário ───────────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--clr-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.forgot-link {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--clr-primary);
  transition: color var(--dur) var(--ease);
}
.forgot-link:hover { color: var(--clr-primary-dark); }

/* Input wrapper */
.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: 14px;
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
  transition: color var(--dur) var(--ease);
}

.form-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-size: 0.92rem;
  color: var(--clr-text);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  outline: none;
  min-height: 42px;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow   var(--dur) var(--ease),
    background   var(--dur) var(--ease);
  -webkit-appearance: none;
}
.form-input::placeholder { color: #b8c4cc; }
.form-input:hover:not(:focus) { border-color: #c8d3e0; }
.form-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 4px var(--clr-primary-glow);
}
.form-input:focus ~ .form-input-icon,
.form-input:focus + .form-input-icon {
  color: var(--clr-primary);
}

/* Error state */
.form-group--error .form-input {
  border-color: var(--clr-error);
  background: var(--clr-error-bg);
}
.form-group--error .form-input:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}
.form-group--error .form-input-icon { color: var(--clr-error); }

.form-error {
  font-size: 0.78rem;
  color: var(--clr-error);
  min-height: 16px;
  line-height: 1.4;
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  padding: 4px;
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur) var(--ease);
  border-radius: var(--radius-xs);
}
.toggle-password:hover { color: var(--clr-text); }
.toggle-password:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}
#password { padding-right: 44px; }

/* ── 10. Checkbox ─────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-xs);
  background: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
}
.checkbox-wrapper:hover .checkbox-custom {
  border-color: var(--clr-primary-light);
}
.checkbox-wrapper input:checked ~ .checkbox-custom {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}
.checkbox-wrapper input:checked ~ .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}
.checkbox-label {
  font-size: 0.84rem;
  color: var(--clr-text-muted);
}

/* ── 11. Botões ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
  white-space: nowrap;
  min-height: 42px;
}

.btn--full { width: 100%; margin-top: 2px; }

/* Ripple shimmer */
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255,255,255,0.12) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn--primary:hover::after { transform: translateX(100%); }

.btn--primary {
  background: linear-gradient(135deg, var(--clr-primary-dark), var(--clr-primary));
  color: white;
  box-shadow: var(--shadow-btn);
  letter-spacing: 0.01em;
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
}
.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-btn);
}
.btn--primary:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state */
.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Social buttons */
.social-buttons {
  display: flex;
  gap: 10px;
  margin-top: 0;
}

.btn--social {
  flex: 1;
  padding: 9px 10px;
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.btn--social:hover {
  background: var(--clr-bg);
  border-color: #c4cdd8;
  box-shadow: var(--shadow-xs);
}

/* ── 12. Divisor ─────────────────────────────────────────────────────────── */
.divider {
  position: relative;
  text-align: center;
  margin: 12px 0;
}
.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--clr-border);
}
.divider span {
  position: relative;
  background: var(--clr-white);
  padding: 0 16px;
  font-size: 0.78rem;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── 13. Link de Cadastro ────────────────────────────────────────────────── */


/* ── 15. Animações SVG ───────────────────────────────────────────────────── */
@keyframes twinkle {
  0%, 100% { opacity: var(--op, 0.8); }
  50%       { opacity: 0.15; }
}
.twinkle {
  animation: twinkle 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.3s);
}

@keyframes blink {
  0%, 88%, 100% { opacity: 0.92; }
  92%           { opacity: 0.08; }
  96%           { opacity: 0.92; }
}
.blink { animation: blink 3.5s ease-in-out infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 0.75s linear infinite; }

/* ── 16. Responsivo ──────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .panel--left { flex: 0 0 50%; }
  .hero-backdrop {
    background-position: center center;
  }
}

@media (max-height: 860px) {
  .panel--left {
    flex-basis: 55%;
  }

  .panel--right {
    padding: 12px 16px;
  }

  .login-card__header {
    margin-bottom: 12px;
  }

  .login-card__header h2 {
    font-size: 1.42rem;
  }

  .login-form {
    gap: 10px;
  }

  .mobile-logo {
    margin-bottom: 10px;
  }

  .divider {
    margin: 10px 0;
  }
}

@media (max-height: 720px) {
  .panel--right {
    padding: 10px 14px;
  }

  .login-wrapper {
    max-width: 388px;
  }

  .login-card__header {
    margin-bottom: 10px;
  }

  .login-card__header h2 {
    font-size: 1.34rem;
  }

  .login-form {
    gap: 8px;
  }

  .form-group {
    gap: 4px;
  }

  .form-input {
    min-height: 40px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .btn {
    min-height: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .divider {
    margin: 8px 0;
  }
}

@media (max-width: 800px) {
  .app-container { flex-direction: column; }

  .panel--left {
    flex: 0 0 clamp(120px, 26vh, 180px);
    height: clamp(120px, 26vh, 180px);
    min-height: unset;
  }

  .hero-backdrop {
    background-position: center top;
  }

  .panel-brand {
    padding: 0;
  }

  .panel--right {
    flex: 1;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 12px 12px 14px;
  }
  .login-card__header h2 { font-size: 1.38rem; }
  .login-card__header p { font-size: 0.86rem; }
  .social-buttons {
    gap: 8px;
  }

}

@media (max-width: 480px) {
  .panel--left { flex: 0 0 112px; height: 112px; }
  .panel--right { padding: 8px 10px 12px; }
  .login-form { gap: 10px; }
  .form-input { font-size: 0.9rem; }
  .social-buttons { flex-direction: column; }
  .btn--social { flex: none; }
  .login-card__header { margin-bottom: 8px; }
  .login-card__header h2 { font-size: 1.24rem; }
  .login-card__header p { font-size: 0.82rem; }
  .form-label,
  .checkbox-label { font-size: 0.8rem; }
  .divider span { font-size: 0.72rem; }
}

/* ── 17. Foco visível (acessibilidade) ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}
