/* 
COMPONENTS
- cards
- buttons
- modals
- forms
- progress bars
*/

/* CARDS */

.auth-screen {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.auth-hero {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 560px;
  padding: 34px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(6, 27, 18, 0.84), rgba(6, 27, 18, 0.7)),
    radial-gradient(circle at 22% 18%, rgba(46, 204, 113, 0.34), transparent 32%),
    linear-gradient(145deg, #111714, #07100c);
  border: 1px solid rgba(46, 204, 113, 0.14);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

.auth-hero .auth-logo {
  margin: 0 0 8px;
}

.auth-kicker,
.auth-card-header span {
  color: #7dd3a4;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-hero h1 {
  max-width: 560px;
  color: #ffffff;
  font-size: 2.15rem;
  line-height: 1.08;
}

.auth-hero p {
  max-width: 540px;
  color: #cbd5e1;
  line-height: 1.55;
}

.auth-help {
  color: #cbd5e1;
  line-height: 1.45;
}

.auth-footer a {
  color: #86efac;
  text-decoration: none;
  font-weight: 700;
}

.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(145deg, #161c18, #111714);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.auth-card-header {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
}

.auth-card-header strong {
  color: #ffffff;
  font-size: 1.35rem;
}

.auth-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 22px;
  filter: drop-shadow(0 0 10px rgba(46, 204, 113, 0.28));
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tabs button {
  background: #0f1412;
  color: #cbd5e1;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.auth-tabs button.active {
  background: #14532d;
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-form label:not(.terms-check) {
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-error {
  min-height: 20px;
  margin-bottom: 10px;
  color: #fca5a5;
  font-size: 0.9rem;
}

.auth-error.success {
  color: #86efac;
}

.terms-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  margin: 4px 0;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.35;
}

.terms-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #2ecc71;
}

.link-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #86efac;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  box-shadow: none;
}

.link-button:hover {
  color: #bbf7d0;
}

.auth-form > .link-button {
  justify-self: center;
  text-align: center;
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: #64748b;
  font-size: 0.84rem;
}

.card {
  background: linear-gradient(145deg, #161c18, #111714);

  padding: 22px;

  border-radius: 16px;

  border: 1px solid rgba(255, 255, 255, 0.03);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.card h3 {
  margin-bottom: 15px;
  color: #2ecc71;
}

.card:hover,
.transaction-card:hover {
  transform: translateY(-3px);
  transition: 0.2s ease;
}

/* BALANCE CARD */

.balance-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #14532d, #166534);

  padding: 30px;

  border-radius: 16px;

  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(46, 204, 113, 0.15);
}

.balance-card p {
  opacity: 0.8;
  font-size: 14px;
}

.balance-card h2 {
  font-size: 20px;
  margin-top: 5px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* INPUTS */

input,
select {
  background: #0f1412;
  border: 1px solid #2ecc71;
  color: #e5e5e5;
  padding: 6px 8px;
  border-radius: 8px;
  width: 100%;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;

  border-color: #2ecc71;

  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.15);
}

/* BOTÕES */

button {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s ease;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #0f1412;
  padding: 8px 14px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
  padding: 10px 16px;
}

.btn-primary:hover {
  transform: translateY(-1px);

  box-shadow: 0 6px 14px rgba(46, 204, 113, 0.5);
}

.btn-secondary {
  background: #14532d;
  color: #e5e5e5;
}

.btn-pro {
  min-height: 38px;
  padding-inline: 14px;
  background: #d9f99d;
  color: #15330f;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(217, 249, 157, 0.22);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-pro:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.logout-button {
  min-height: 32px;
  padding-inline: 12px;
}

/* PRO */

.pro-screen {
  display: grid;
  gap: 18px;
}

.pro-header,
.pro-pricing,
.pro-preview,
.pro-benefit,
.pro-support-card {
  background: linear-gradient(145deg, #161c18, #111714);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.pro-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
}

.pro-kicker,
.pro-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.16);
  color: #86efac;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pro-header h2 {
  margin: 10px 0 8px;
  color: #ffffff;
  font-size: 1.5rem;
}

.pro-header p,
.pro-note,
.pro-preview p,
.pro-benefit p,
.pro-support-card p {
  color: #cbd5e1;
  line-height: 1.5;
}

.pro-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 18px;
}

.pro-pricing,
.pro-preview,
.pro-benefit,
.pro-support-card {
  padding: 22px;
}

.pro-pricing {
  display: grid;
  gap: 12px;
}

.pro-pricing h3,
.pro-preview h3,
.pro-benefit h3,
.pro-support-card h3 {
  color: #2ecc71;
}

.pro-price {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
}

.pro-preview {
  border-color: rgba(217, 249, 157, 0.16);
}

.pro-preview p {
  margin-top: 12px;
  font-size: 1.05rem;
}

.pro-benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pro-support-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 8px;
  color: #e5e5e5;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pro-account-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
  gap: 20px;
  align-items: start;
  padding: 22px;
  background: linear-gradient(145deg, #161c18, #111714);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.pro-account-card h3 {
  margin: 10px 0 8px;
  color: #ffffff;
}

.pro-account-card p,
.profile-status {
  color: #cbd5e1;
  line-height: 1.5;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.profile-field {
  display: grid;
  gap: 7px;
}

.profile-form label,
.profile-status {
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-form button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 180px;
}

.profile-status {
  grid-column: 1 / -1;
  min-height: 18px;
  font-weight: 600;
}

.terms-modal {
  max-width: 620px;
}

.terms-content {
  display: grid;
  gap: 14px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 6px;
  color: #dbe5df;
  line-height: 1.55;
}

/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: 95%;
  max-width: 480px;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  animation: fadeIn 0.3s ease;
}

.modal input,
.modal select,
.limit-modal-content input {
  min-height: 40px;
  padding: 9px 12px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-header h3 {
  color: #ffffff;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
}

/* PROGRESS BAR */

.progress-bar {
  width: 100%;
  height: 18px;
  background: #1f2b24;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

#progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.8s ease;
}

.floating-action {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.floating-action-primary {
  bottom: max(24px, env(safe-area-inset-bottom));
  background: #2ecc71;
  color: #0f1412;
  font-size: 32px;
}

.floating-action-secondary {
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 72px);
  width: 44px;
  height: 44px;
  right: max(31px, env(safe-area-inset-right));
  background: rgba(20, 83, 45, 0.94);
  color: #e5e5e5;
  border: 1px solid rgba(134, 239, 172, 0.26);
  font-size: 20px;
}

.floating-action:hover {
  transform: translateY(-2px);
}

.floating-action:focus-visible {
  outline: 2px solid #d9f99d;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .top-grid,
  .middle-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chart-container {
    height: 300px;
  }

  thead {
    display: none;
  }

  .modal {
    padding: 20px;
  }
}

/* FORM TRANSACTION GRID */

.transaction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.transaction-grid button {
  grid-column: span 2;
  min-height: 46px;
  margin-top: 3px;
}

/* LIMIT MODAL */

.limit-modal {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.6);

  display: none;

  justify-content: center;
  align-items: center;

  z-index: 1100;
}

.limit-modal.active {
  display: flex;
}

.limit-modal-content {
  background: #1f2937;
  display: grid;
  gap: 14px;
  width: min(360px, calc(100vw - 28px));
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.limit-modal-content h3 {
  color: #ffffff;
}

.limit-modal-content p {
  color: #cbd5e1;
  min-height: 20px;
}

.limit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.limit-actions button {
  min-height: 38px;
  padding: 9px 14px;
}

@media (max-width: 768px) {
  .transaction-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .transaction-grid button {
    grid-column: 1;
  }

  .limit-actions {
    flex-direction: column-reverse;
  }

  .limit-actions button {
    width: 100%;
  }
}

.chart-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.chart-header h3 {
  text-align: center;
}

#toggle-chart-mode {
  justify-self: start;
}

#toggle-chart-period {
  justify-self: end;
}

#transaction-modal {
  position: fixed;
  inset: 0;

  display: none;

  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.6);

  z-index: 999;
}

#transaction-modal.active {
  display: flex;
}

#transaction-form {
  margin-top: 10px;
}

#cancel-transaction {
  width: 28px;
  height: 28px;

  border: none;
  border-radius: 50%;

  background: #ef4444;
  color: white;

  cursor: pointer;
}

#cancel-transaction:hover {
  background: #dc2626;
}

.row-updated {
  animation: highlightUpdate 0.7s ease;
}

.card-new {
  animation: rowInsert 0.45s ease;
}

.skeleton td {
  position: relative;
  overflow: hidden;
}

.skeleton td::after {
  content: "";

  position: absolute;
  top: 0;
  left: -150px;

  width: 150px;
  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );

  animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
  0% {
    left: -150px;
  }

  100% {
    left: 100%;
  }
}

.skeleton-card {
  height: 70px;
  border-radius: 12px;
  background: #1a1f1c;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150px;
  width: 150px;
  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );

  animation: skeleton-loading 1.2s infinite;
}

.chart-skeleton {
  width: 220px;
  height: 220px;

  border-radius: 50%;

  margin: auto;

  background: conic-gradient(
    #1f2b24 0% 25%,
    #24332b 25% 50%,
    #1f2b24 50% 75%,
    #24332b 75% 100%
  );

  position: relative;

  animation: rotateSkeleton 1.6s linear infinite;
}

.chart-skeleton::after {
  content: "";

  position: absolute;

  top: 50%;
  left: 50%;

  width: 120px;
  height: 120px;

  transform: translate(-50%, -50%);

  border-radius: 50%;

  background: #1a1f1c;
}

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

  to {
    transform: rotate(360deg);
  }
}

@keyframes highlightUpdate {
  0% {
    background: rgba(46, 204, 113, 0.45);
  }

  100% {
    background: transparent;
  }
}

.transaction-card.updated {
  animation: highlightUpdate 0.7s ease;
}

.row-new {
  animation: rowInsert 0.45s ease;
}

@keyframes rowInsert {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
