/* ---------- 主要配色：可在單一 <form class="form"> 上覆寫 ---------- */
.form {
  --brand: #2260ff;
  --bg: #fafafe;
  --line: #d5d9e0;
  --text: #343a46;
  --icon: #707c8f;

  margin: auto;
  width: 80%;
  max-width: 720px;
  margin: 40px auto;
  text-align: center;
  position: relative;
}

/* ---------- 欄位列 ---------- */
.form .row {
  position: relative; /* ★ 新增 */
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}

.form fieldset {
  background: rgba(255, 255, 255, 0.8);
  border: 0 none;
  border-radius: 8px;
  box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
  padding: 20px 30px;
  box-sizing: border-box;
  width: 100%;
  position: relative;
}

/*Hide all except first fieldset*/
.form fieldset:not(:first-of-type) {
  display: none;
}

/*inputs*/
/* .form input,
.form textarea {
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
  font-family: montserrat;
  color: #2c3e50;
  font-size: 13px;
} */

/*buttons*/
.form .btn {
  width: 250px;
  min-width: 200px;
  max-width: 300px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  padding: 10px;
  margin: 10px 5px;
}

/* ---------- 左側圖示 ---------- */
.form .icon {
  flex: 0 0 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--icon);
  background: var(--bg);
  border: 2px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-sizing: border-box;
}

.form .icon2 {
  flex: 0 0 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  color: var(--icon);
}

/* 眼睛按鈕 */
.form .eye {
  position: absolute;
  top: 50%;
  right: 14px; /* 與 input padding 對齊 */
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--icon);
  cursor: pointer;
  line-height: 1;
}

/* 給密碼框預留空位，避免文字被眼睛蓋到 */
.form .row input[type="password"] {
  padding-right: 46px;
}

/* =========== 共同輸入框樣式 =========== */
.form input,
.form select {
  flex: 1;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #ffffff;
  border: 2px solid var(--line);
  border-left: none;
  border-radius: 0 8px 8px 0;
  outline: 0;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form textarea {
  flex: 1;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #ffffff;
  border: 2px solid var(--line);
  border-left: none;
  border-radius: 0 8px 8px 0;
  outline: 0;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form textarea:placeholder-shown {
  line-height: 42px;
}

.form input:focus,
.form textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* 可選的拖放樣式 */
.form .file-upload-area.dragover {
  border-color: #007bff;
  background-color: #f0f8ff;
}

.form .file-upload-label {
  cursor: pointer;
  padding: 10px 15px;
  background-color: #ffffff;
  border: 1px dashed goldenrod;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: calc(100% - 40px);
  height: 150px;
  box-sizing: border-box;
}

.form .row.file-upload-area {
  display: flex;
  align-items: center;
}

/* ---------- 小螢幕：icon 疊在輸入框上方 ---------- */
/* @media (max-width: 420px) {
  .form .row {
    flex-direction: column;
  }
  .form .icon {
    border-radius: 8px 8px 0 0;
    border-right: 2px solid var(--line);
  }
  .form .input {
    border-left: 2px solid var(--line);
    border-radius: 0 0 8px 8px;
    width: 100%;
  }
} */

/* ========== 響應式設計：手機版 ========== */
@media screen and (max-width: 500px) {
  .form {
    width: 95%;
    margin: 20px auto;
  }

  .form fieldset {
    padding: 15px 20px;
  }

  /* 保持 icon 和 input 的水平排列 */
  .form .row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
  }

  /* 調整 icon 大小 */
  .form .icon {
    flex: 0 0 40px;
    font-size: 16px;
    border-radius: 6px 0 0 6px;
  }

  /* 調整 input 大小 */
  .form input,
  .form select {
    flex: 1;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 0 6px 6px 0;
  }

  /* 調整按鈕 */
  .form .btn {
    width: 100%;
    margin: 10px 0;
  }

  /* 調整眼睛按鈕位置 */
  .form .eye {
    right: 12px;
    font-size: 18px;
  }

  /* 調整密碼框的 padding */
  .form .row input[type="password"] {
    padding-right: 40px;
  }
}

/* 更小的螢幕 */
@media screen and (max-width: 360px) {
  .form .icon {
    flex: 0 0 36px;
    height: 36px;
    font-size: 14px;
  }

  .form input,
  .form select {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
}
