<template>
  <div class="form-banner">
    <div class="banner-content">
      <div
        style="
          display: flex;
          align-items: center;
          justify-content: center;
          margin-bottom: 20px;
        "
      >
        <img src="../../assets/images/form_img6.png" alt="" />
        <h2 style="padding: 0 10px">了解更多企业的数字化实践案例</h2>
        <img src="../../assets/images/form_img7.png" alt="" />
      </div>

      <div class="form-container">
        <div class="form-row">
          <div class="form-field">
            <label
              for=""
              style="position: absolute; top: 25%; padding-left: 5px"
            >
              <Icon icon="mdi-light:account" width="24" height="24" />
            </label>
            <input type="text" placeholder="您的称呼" class="form-input" />
          </div>
          <div class="form-field">
            <label
              for=""
              style="position: absolute; top: 28%; padding-left: 5px"
            >
              <Icon icon="mdi-light:phone" width="20" height="20" />
            </label>
            <input type="tel" placeholder="您的手机号" class="form-input" />
          </div>
          <div class="form-field">
            <div class="input-with-icon">
              <input
                type="text"
                placeholder="请输入验证码"
                class="form-input"
              />
              <img
                src="@/assets/images/logo.png"
                alt="MRNT"
                class="verification-logo"
              />
            </div>
          </div>
        </div>

        <div class="form-row">
          <div class="form-field">
            <div class="input-with-icon">
              <input type="text" placeholder="短信验证码" class="form-input" />
              <button class="btn-get-code">获取</button>
            </div>
          </div>
          <div class="form-field">
            <label
              for=""
              style="position: absolute; top: 27%; padding-left: 5px"
            >
              <Icon icon="tabler:building" width="20" height="20" />
            </label>
            <input type="text" placeholder="单位名称" class="form-input" />
          </div>
          <div class="form-field">
            <label
              for=""
              style="position: absolute; top: 25%; padding-left: 5px"
            >
              <Icon icon="mdi-light:sitemap" width="20" height="20" />
            </label>
            <input type="text" placeholder="所在部门" class="form-input" />
          </div>
        </div>

        <div class="form-submit">
          <button class="btn-submit">提交</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 表单逻辑可以在这里添加
import { ref } from "vue";
import { Icon } from "@iconify/vue";

const formData = ref({
  name: "",
  phone: "",
  verificationCode: "",
  smsCode: "",
  unitName: "",
  department: "",
});

const handleGetCode = () => {
  // 获取验证码逻辑
  console.log("获取验证码");
};

const handleSubmit = () => {
  // 提交表单逻辑
  console.log("提交表单", formData.value);
};
</script>

<style scoped>
.form-banner {
  position: relative;
  height: 350px;
  background-image: url("@/assets/images/form_back.png");

  background-origin: padding-box;
  background-position-x: 0%;
  background-position-y: 0%;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  /* padding: 40px 0; */
}

.form-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  z-index: 1;
}

.banner-content {
  position: relative;
  z-index: 2;
  color: white;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.banner-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.banner-subtitle {
  font-size: 25px;
  opacity: 0.9;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

/* .form-container {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 32px;
  backdrop-filter: blur(10px);
} */

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-field {
  flex: 1;
  min-width: 0;
  position: relative;
}

.form-input {
  width: 100%;
  padding: 16px 30px;
  border: 0.5px solid rgba(255, 255, 255, 0.7);

  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 14px;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
  outline: none;
  border-color: white;
}

.input-with-icon {
  position: relative;
}

.verification-logo {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
}

.btn-get-code {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #4a90e2;
  font-size: 14px;
  cursor: pointer;
}

.form-submit {
  text-align: left;
}

.btn-submit {
  background: #fff;
  color: #1b54a7;
  border: none;
  padding: 10px 60px;
  width: 32%;
  font-size: 14px;

  cursor: pointer;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: #3a7bc8;
}
</style>
