
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


:root {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  
  --bg-color: #0b101e;
  --surface-color: rgba(23, 32, 51, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #e2e8f0;
  --text-muted: #8b9bb4;
  --accent-color: #00f2fe; 
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* --- ESTILIZAÇÃO DA BARRA DE ROLAGEM --- */
::-webkit-scrollbar {
  width: 0.5rem;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a3b5c;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* --- ESTILO DO BODY --- */
body {
  width: 100%;
  height: 100vh;
  
/* criando ponto de luz */
  background: radial-gradient(circle at top left, #1a2640 0%, #0b101e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-main);
}

/* Filtro para clarear icones que eram escuros */
.logo, .expense img:first-child, .remove-icon {
  filter: invert(0.8) drop-shadow(0 0 2px rgba(255,255,255,0.2));
}

.logo {
  margin: 3rem 0 2rem;
}

main section {
  display: flex;
  flex: 1;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

/* --- CONTAINER DO FORMULÁRIO E RESUMO  --- */
form, aside {
  /* pra fazer o efeito vidro edeixa o background semi-transparente + blur */
  background-color: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

form {
  max-width: 462px;
  display: flex;
  flex-direction: column;
}

form h1 {
  font-size: 1.25rem;
  color: #ffffff;
  letter-spacing: 0.5px;
}

form p {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin: 0.75rem 0 2.5rem;
  line-height: 1.5;
}

/* --- CAMPOS DE ENTRADA (INPUTS E SELECT) --- */
fieldset {
  border: none;
  display: flex;
}

fieldset legend {
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

/* Quando o usuário clica no campo, o rótulo (legend) ganha destaque */
fieldset:focus-within legend {
  color: var(--accent-color);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

input, select {
  flex: 1;
  height: 3rem;
  border-radius: 0.5rem;
  border: 1px solid #2a3b5c;
  padding: 0 1rem;
  font-size: 0.87rem;
  color: #ffffff;
  background-color: rgba(11, 16, 30, 0.5); 
  outline: none;
  transition: all 0.3s ease;
}

/* Troca do ícone padrão do select por um ícone customizado em azul neon */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300f2fe' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem top 50%;
  background-size: 1.25rem auto;
}

select option {
  background-color: var(--bg-color);
  color: var(--text-main);
}

input::placeholder, select:invalid {
  color: #4a5d7c;
}

input:focus, select:focus {
  border: 1.5px solid var(--accent-color);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15); 
  background-color: rgba(11, 16, 30, 0.8);
}

.inputs-row {
  display: flex;
  flex: 1;
  gap: 1rem;
  margin-top: 1rem;
}

.inputs-row fieldset:first-child {
  flex: 1;
}

.inputs-row fieldset:last-child input {
  max-width: 154px;
}

/* --- BOTÃO ADICIONAR --- */
form button {
  height: 3rem;
  border-radius: 0.5rem;
  border: none;
  font-size: 0.87rem;
  color: #ffffff;
  background: var(--accent-gradient);
  font-weight: 700;
  padding: 1rem 1.25rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
  transition: all 0.3s ease;
}

button:hover {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

form button:last-child {
  margin-top: 2.5rem;
}

/* --- LADO DIREITO (RESUMO E LISTA) --- */
aside {
  max-width: 462px;
  min-width: 600px;
}

aside header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

aside header p {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
}

aside header p span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.87rem;
}

aside header p i {
  color: #2a3b5c;
  margin: 0 0.5rem;
  font-style: normal;
}

aside header h2 {
  font-size: 1.25rem;
  color: var(--accent-color); 
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

aside header small {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  text-shadow: none;
}

/* --- LISTA DE ITENS --- */
aside ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 310px;
  min-height: 310px;
  overflow-y: scroll;
  padding-right: 0.5rem; 
}

.expense {
  display: flex;
  align-items: center;
  height: 48px; 
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.03); 
  border: 1px solid transparent;
  transition: border 0.3s, background-color 0.3s;
}

.expense:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.expense img:first-child {
  width: 2rem;
  height: 2rem;
  margin-right: 0.75rem;
}

.expense > div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.expense-info strong {
  font-size: 0.87rem;
  color: #ffffff;
}

.expense-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expense-amount {
  font-size: 0.87rem;
  color: #ffffff;
  font-weight: 600;
}

.expense-amount small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 0.25rem;
}

/* Ícone de remoção que brilha em vermelho ao passar o mouse */
.remove-icon {
  height: 1rem;
  margin-left: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}

.remove-icon:hover {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 100, 100, 0.8)) invert(0.8); 
}


@media (min-width: 1100px) {
  form {
    max-height: 440px;
  }
}

@media (max-width: 1100px) {
  :root {
    font-size: 14px;
  }
  main, aside {
    min-width: 100%;
  }
  main section {
    flex-direction: column;
    width: 100%;
    padding: 1.5rem;
  }
  main section form, aside {
    min-width: 100%;
    backdrop-filter: blur(10px); 
  }
  main section aside ul {
    width: 100%;
    height: auto;
    overflow: auto;
  }
}

@media (max-width: 620px) {
  .inputs-row {
    flex-direction: column;
  }
  .inputs-row fieldset:last-child input {
    max-width: none;
    min-width: 100%;
  }
  aside header {
    flex-direction: column;
    align-items: center;
  }
}