"use client";
/**
 * 法律声明（Terms / Privacy + 复选框）
 *
 * 
 *
 * 视觉规格（与 Dart 对齐）：
 *   - 行：16px 白色圆形复选框 + 12px 富文本
 *   - 复选框：白底 + 1px 白色边框；选中时 10px 粉色实心圆
 *   - 默认选中（仅视觉，不阻塞提交）
 *   - 链接加粗（Privacy Policy / Terms of Service）
 *   - 文字深色
 */
import { useState } from "react";

import { AppConstants } from "@/core/app_constants";

import styles from "./auth-legal-text.module.css";

export function AuthLegalText() {
  const [checked, setChecked] = useState(true);

  return (
    <div className={styles.row}>
      <button
        type="button"
        className={styles.checkbox}
        onClick={() => setChecked((c) => !c)}
        aria-label="Agree to terms"
        aria-pressed={checked}
      >
        {checked ? <span className={styles.checkboxInner} /> : null}
      </button>
      <p className={styles.text}>
        I agree to the Cozsweet {" "}
        <a
          href={AppConstants.privacyPolicyUrl}
          className={styles.link}
          target="_blank"
          rel="noreferrer"
        >
          Privacy Agreement
        </a>{" "}
        and{" "}
        <a
          href={AppConstants.termsOfServiceUrl}
          className={styles.link}
          target="_blank"
          rel="noreferrer"
        >
          Terms of User
        </a>
      </p>
    </div>
  );
}
