/* ===== Base ===== */

body.cbt-login {
    background-color: #F5F6F8;
  
    background-image:
      linear-gradient(to right, rgba(33,37,41,0.06) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(33,37,41,0.06) 1px, transparent 1px);
    background-size: 32px 32px, 32px 32px;
  
    font-family: "BIZ UD Gothic", sans-serif;
    margin: 0;
    color: #212529;
  }
  
  /* ===== Top Bar ===== */
  
  .top-bar {
    background: #E2041B;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* ★ここを修正（レスポンシブ対応） */
  .top-title {
    color: #ffffff;
    font-size: clamp(28px, 6vw, 70px);
    font-weight: 800;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    line-height: 1;
  }
  
  /* ===== Layout ===== */
  
  .login-wrapper {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
  }
  
  .login-card {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(33, 37, 41, 0.08);
    padding: 48px;
    border: 1px solid rgba(222, 226, 230, 0.65);
  }
  
  /* =========================================================
     共通ページタイトル
     ========================================================= */
  
  .login-card .page-title {
    font-size: 30px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 6px 0;
  }
  
  .login-card .page-subtitle {
    font-size: 17px;
    font-weight: 500;
    color: #6C757D;
    text-align: center;
    margin: 0 0 26px 0;
  }
  
  /* ===== Grid ===== */
  
  .login-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
  }
  
  /* ===== Form ===== */
  
  .form-group label {
    font-weight: 700;
    margin-bottom: 6px;
  }
  
  .en-label {
    font-weight: 400;
    font-size: 14px;
    color: #6C757D;
  }
  
  .form-control {
    height: 46px;
    border-radius: 6px;
    border: 1px solid #DEE2E6;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
  
  .form-control:focus {
    border-color: #E2041B;
    box-shadow: 0 0 0 3px rgba(226, 4, 27, 0.12);
    outline: none;
  }
  
  /* ===== Buttons ===== */
  
  .button-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
  }
  
  .button-row .btn {
    flex: 1;
    border-radius: 8px;
    font-weight: 700;
    padding: 12px;
    transition: all 0.18s ease;
  }
  
  .button-row.is-single {
    justify-content: center;
  }
  
  .button-row.is-single .btn {
    flex: 1;
    max-width: 250px;
  }
  
  /* ===== Button Colors ===== */
  
  .btn-primary {
    background: #E2041B;
    border: 1px solid #E2041B;
    color: #ffffff;
  }
  
  .btn-primary:hover,
  .btn-primary:focus,
  .btn-primary:active {
    background: #B00316;
    border-color: #B00316;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(226, 4, 27, 0.20);
  }
  
  .btn-secondary {
    background: #6C757D;
    border: 1px solid #6C757D;
    color: #ffffff;
  }
  
  .btn-secondary:hover,
  .btn-secondary:focus,
  .btn-secondary:active {
    background: #212529;
    border-color: #212529;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(33, 37, 41, 0.18);
  }
  
  /* ===== QR ===== */
  
  .qr-area {
    text-align: center;
  }
  
  .qr-title {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 6px;
  }
  
  #status {
    font-size: 14px;
    color: #6C757D;
    margin-bottom: 8px;
  }
  
  #status:empty {
    display: none;
    margin-bottom: 0;
  }
  
  #my_camera {
    width: 300px;
    height: 380px;
    margin: 0 auto;
    border-radius: 12px;
    background: #F5F6F8;
    border: 1px solid #DEE2E6;
    overflow: hidden;
  }
  
  #results img {
    max-width: 300px;
    border-radius: 12px;
    /* margin-top: 12px; */
  }
  
  /* ===== Responsive ===== */
  
  @media (max-width: 860px) {
    .login-grid {
      grid-template-columns: 1fr;
      gap: 28px;
    }
  
    .login-card {
      padding: 28px;
    }
  
    /* ← ここ削除（clampで制御するため不要） */
    /* .top-title { font-size: 44px; } */
  
    .camera-wrapper,
    #my_camera,
    #results img {
      width: min(300px, 100%);
    }
  
    .page-title {
      font-size: 24px;
    }
  
    .page-subtitle {
      font-size: 15px;
    }
  }
  
  /* ===== Waiting Title Styles ===== */
  
  .login-card .exam-level,
  .login-card .exam-field {
    font-size: 58px;
    font-weight: 800;
    margin: 0 0 24px 0;
    text-align: center;
  }
  
  .login-card .exam-time {
    font-size: 20px;
    margin: 0 0 32px 0;
    text-align: center;
  }
  
  .login-card .exam-time .time-number {
    font-size: 24px;
    font-weight: 800;
  }
  
  
   
  /* 04待機 / 05待機 の右カラム構造統一用 */
  .qr-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
   
  .camera-wrapper {
    position: relative;
    width: 300px;
    height: 380px;
    margin: 0 auto;
  }
   
  
   
  .qr-guide-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
   
  .qr-corner {
    position: absolute;
    width: 58px;
    height: 58px;
    border-color: #0A66FF;
    border-style: solid;
    border-width: 0;
    border-radius: 4px;
    opacity: 0.95;
  }
   
  .qr-corner.top-left {
    top: 90px;
    left: 50px;
    border-top-width: 4px;
    border-left-width: 4px;
  }
   
  .qr-corner.top-right {
    top: 90px;
    right: 50px;
    border-top-width: 4px;
    border-right-width: 4px;
  }
   
  .qr-corner.bottom-left {
    bottom: 90px;
    left: 50px;
    border-bottom-width: 4px;
    border-left-width: 4px;
  }
   
  .qr-corner.bottom-right {
    bottom: 90px;
    right: 50px;
    border-bottom-width: 4px;
    border-right-width: 4px;
  }
   