@font-face {
  font-family: jakarta;
  src: url(PlusJakartaSans-VariableFont_wght.ttf);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  background-color: rgb(88, 160, 200, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background-color: white;
  width: 73rem;
  height: 35rem;
  border-radius: 2rem;
  overflow: hidden;
  display: flex;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

.kalkulator {
  flex: 0 0 55%;
  display: flex;
  flex-direction: column;
  padding: 1rem 0 2rem 2rem;
  background-color: white;
}

.form {
  padding: 0rem 0.5rem 0.5rem;
  font-family: jakarta;
  justify-content: space-between;
}

/* Logo */
.header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logos img {
  width: 8rem;
  margin-bottom: 0.3rem;
}

.logowow {
  width: 12rem;
}

.header h1 {
  font-size: 37px;
  word-spacing: 4px;
  color: #113f67;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  margin: 0;
}

/* Penghapus */

.clear a {
  margin-top: 1rem;
  color: #2c77b8;
  cursor: pointer;
  text-decoration: none;
  margin-right: 3rem;
  position: relative;
  left: 80%;
  transition: color 0.3s ease;
}

.clear a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #2c77b8;
  transition: width 0.3s ease;
}

.clear a:hover::after {
  width: 100%;
}

.clear a:hover {
  color: #185a8c;
}

/* Label */
label {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: #113f67;
  font-weight: 500;
  margin-left: 0.5rem;
}

/* Dropdown */
select {
  margin: 0.5rem 0 1rem 0.2rem;
  width: 70%;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  padding: 0 0.5rem;
  font-size: 1rem;
  background-color: rgb(250, 235, 215, 0.3);
  transition: linear 0.3s;
}

select:hover {
  background-color: rgba(232, 200, 159, 0.5);
  border: 1px solid #a5a5a5;
}

select:focus,
select:active {
  background-color: rgb(250, 235, 215, 0.3);
  border: 1px solid #ccc;
}

.table {
  display: flex;
  justify-content: center;
}

table {
  border: #113f67 2px solid;
  text-align: center;
  width: 90%;
  margin-top: 1rem;
  color: #113f67;
  border-collapse: collapse;
}

td,
th {
  border: #113f67 2px solid;
  text-align: center;
  padding: 0.5rem;
}

thead th {
  font-weight: 700;
}

tbody {
  empty-cells: show;
  line-height: 1.5rem;
}

.inputan input {
  width: 100%;
  text-align: center;
  border: none;
  outline: none;
  color: rgb(17, 63, 103);
  font-size: 17px;
}

.inputan:hover {
  background-color: rgba(72, 141, 202, 0.3);
}

.inputan:hover input {
  background-color: transparent;
}

.inputan:has(input:focus) {
  background-color: transparent;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ringkasan */
.ringkasan {
  width: 50%;
  background-color: #113f67;
  color: white;
  font-family: jakarta;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 1.5rem;
  border-bottom-left-radius: 3rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
}

.ringkasan h1 {
  align-self: flex-start;
  margin: 1rem 0 1rem 0;
  color: #fff;
  font-size: 2rem;
}

/*  grand total  */
.ringkasan .savings {
  width: 90%;
  margin: 0.8rem auto 0;
  background: #c7d70e;
  color: #113f67;
  padding: 0.6rem 1rem;
  border-radius: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.ringkasan .savings #savings {
  color: #113f67;
}

.kata-kata {
  text-align: center;
  margin-top: 2rem;
}

.guide-text {
  font-size: 15px;
  color: #c7d70e;
  margin-top: 3rem;
  text-align: center;
  padding: 0rem 1.5rem;
}

.edit-data {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  margin: 1rem;
}

.edit-data button {
  width: 5rem;
  height: 2rem;
  color: #113f67;
  background-color: #c7d70e;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.edit-data button:hover {
  background-color: #a1af0c;
}

.edit-data button:active {
  background-color: #bfcf16;
}

/* Pop up login */

/* Background abu-abu */
#loginModalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 999;
  font-family: jakarta;
  color: #113f67;
}

/* Box modal */
#loginModal {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

#loginModal input {
  width: 90%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: jakarta;
  color: #113f67;
}

#loginModal input:hover {
  border-color: #113f67;
}

#loginModal input:focus {
  border-color: #1b4e8c;
  outline: 1px solid #113f67;
}

#loginModal button {
  width: 90%;
  padding: 10px;
  background: #113f67;
  color: white;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
}

#loginModal button:hover {
  background: #0b3051;
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.eye-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 20px;
  height: 20px;
  color: #113f67;
}

.eye-icon:hover {
  color: #185487;
}

/* KALKULATOR TABLE (DINAMIS) */

/* Table */
.tabel table {
  border: #113f67 2px solid;
  text-align: center;
  width: 90%;
  margin-top: 1rem;
  color: #113f67;
  border-collapse: collapse;
}

/* Header (Before / After / Output) */
.tabel thead th {
  font-weight: 700;
  background-color: #f5f9fc;
}

/* Unit row (kWh, kg, FTE, dll) */
.tabel thead tr.unit-row td {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c77b8;
  background-color: #eef5fb;
}

/* Body */
.tabel tbody td {
  padding: 0.5rem;
}

/* INPUT */
.tabel tbody input {
  width: 100%;
  text-align: center;
  border: none;
  outline: none;
  font-family: jakarta;
  font-size: 17px;
  color: #113f67;
  background-color: transparent;
}

/* Hover row */
.tabel tbody tr:hover {
  background-color: rgba(72, 141, 202, 0.25);
}

/* Focus input */
.tabel tbody input:focus {
  background-color: transparent;
}

/* Disable spinner */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* === Shake Animation === */
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: shake 0.3s ease;
}

/* MODAL OVERLAY (REGISTER & LOGIN)  */
#registerModalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
  z-index: 999;
  font-family: jakarta;
  color: #113f67;
}

/* Box modal */
#registerModal {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  /* font-size: 20px; */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

#registerModal input {
  width: 90%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  /* font-size: 15px; */
  border: 1px solid #ccc;
  font-family: jakarta;
}

#registerModal input:hover {
  border-color: #113f67;
}

#registerModal input:focus {
  border-color: #1b4e8c;
  outline: 1px solid #113f67;
}

#registerModal button {
  width: 90%;
  padding: 10px;
  background: #113f67;
  color: white;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
}

#registerModal button:hover {
  background: #0b3051;
}

/* shake  */
#registerModal.shake {
  animation: shake 0.3s ease;
}

/* RESPONSIVE DESIGN  */
/* ================================= */
/* LOGO SAFE SCALE */
/* ================================= */

.header img,
.logowow {
  max-width: 100%;
  height: auto;
}

/* ============================= */
/* HP KECIL (≤480px) */
/* ============================= */

@media (max-width: 480px) {
  .header h1 {
    font-size: 22px;
  }

  label {
    font-size: 1rem;
  }

  select {
    width: 100%;
    height: 2.3rem;
    font-size: 0.9rem;
  }

  .tabel table,
  table {
    width: 100%;
    font-size: 13px;
  }

  .tabel tbody input {
    font-size: 14px;
  }

  .ringkasan h1 {
    font-size: 1.3rem;
  }

  .ringkasan .savings {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .guide-text {
    font-size: 13px;
  }

  .edit-data button {
    width: 4.5rem;
    height: 1.8rem;
    font-size: 12px;
  }

  /* Logo */

  .header img {
    width: 5.5rem;
  }
}

/* ============================= */
/* HP BESAR (481px–768px) */
/* ============================= */

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    flex-direction: column;
    width: 100%;
    height: auto;
  }

  .kalkulator {
    width: 100%;
    padding: 1rem 1.5rem;
  }

  select {
    width: 95%;
  }

  .header h1 {
    font-size: 28px;
  }

  .tabel table,
  table {
    width: 100%;
    font-size: 14px;
  }

  .ringkasan {
    width: 100%;
    padding: 1.5rem;
  }

  .ringkasan h1 {
    font-size: 1.6rem;
  }

  .ringkasan .savings {
    font-size: 0.95rem;
  }

  /* Logo */

  .header img {
    width: 6.5rem;
  }
}

/* ============================= */
/* TABLET (769px–1024px) */
/* ============================= */

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    width: 95%;
    height: auto;
  }

  .kalkulator {
    flex: 0 0 55%;
    padding: 1rem 1.5rem;
  }

  .ringkasan {
    flex: 0 0 45%;
    padding: 1.5rem;
  }

  .header h1 {
    font-size: 32px;
  }

  select {
    width: 80%;
  }

  .tabel table,
  table {
    width: 95%;
  }

  /* Logo */

  .logos img {
    width: 7rem;
  }
}

/* ============================= */
/* GOOGLE NEST HUB (1024x600) */
/* ============================= */
@media (min-width: 900px) and (max-width: 1100px) and (max-height: 700px) {
  body {
    align-items: flex-start;
    padding-top: 1rem;
    position: relative;
  }

  .container {
    margin-top: 4rem;
  }

  .kalkulator {
    flex: 0 0 55%;
    padding: 1rem 1.3rem;
  }

  .ringkasan {
    flex: 0 0 45%;
    padding: 1.3rem;
  }

  .header h1 {
    font-size: 30px;
  }

  select {
    width: 75%;
    height: 2.3rem;
  }

  table {
    font-size: 14px;
  }

  .tabel tbody input {
    font-size: 15px;
  }

  .logos img {
    width: 6.5rem;
  }

  .ringkasan .savings {
    font-size: 0.9rem;
  }
}

@media (max-width: 680px) {
  body {
    height: auto;
    align-items: flex-start;
  }

  .container {
    flex-direction: column;
    width: 100%;
    height: auto;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
  }

  .kalkulator {
    flex: none;
    width: 100%;
    padding: 1rem 1.3rem 1rem 1.5rem;
    position: relative;
    height: 61%;
  }

  select {
    width: 90%;
  }

  .header h1 {
    font-size: 26px;
  }

  .clear a {
    font-size: 15px;
  }

  .ringkasan {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: 1rem;
    position: relative;
    bottom: 0;
    height: 100%;
  }

  .ringkasan h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
  }

  .ringkasan .savings {
    width: 95%;
    font-size: 0.9rem;
  }

  .ringkasan .kata-kata {
    margin: 1rem 0;
    position: relative;
  }

  .ringkasan p {
    margin: 0.7rem 0;
  }

  .inputan input {
    font-size: 13px;
  }

  .edit-data {
    bottom: 0;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .edit-data button {
    position: relative;
  }
}
