@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap');

:root{
  --ax-brand:#016C74;
  --ax-brand-weak:#eaf6f7;

  --ax-border:#e5e5e5;
  --ax-gray:#f2f2f2;
  --ax-bg:#f3f6f6;
  --ax-white:#ffffff;

  --ax-text:#222;
  --ax-text-soft:#666;

  --ax-danger:#b42318;
  --ax-danger-bg:#fff4f2;
  --ax-danger-border:#f1c7c7;

  --ax-shadow:0 10px 30px rgba(0,0,0,.25);
  --ax-shadow-desktop:0 18px 60px rgba(0,0,0,.18);

  --ax-radius-sm:10px;
  --ax-radius-md:12px;
  --ax-radius-lg:14px;
  --ax-radius-xl:16px;
  --ax-radius-2xl:18px;

  --ax-btn-h:48px;
  --ax-btn-h-sm:42px;
  --ax-btn-h-lg:46px;
}

*{
  box-sizing:border-box;
}

html,body{
  height:100%;
}

body{
  margin:0;
  padding:0;
  height:100vh;
  background:var(--ax-bg);
  color:var(--ax-text);
  font-family:"Open Sans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow-x:hidden;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  appearance:none;
  -webkit-appearance:none;
}

button:disabled{
  opacity:.55;
  cursor:not-allowed;
}

#app{
  height:100vh;
}

/* =========================
   LAYOUT HELPERS
========================= */

.ax_page{
  width:100%;
  height:100vh;
  background:#fff;
}

.ax_page_header{
  background:var(--ax-brand);
  color:#fff;
  padding:16px;
  font-weight:800;
  font-size:17px;
  text-align:center;
  letter-spacing:.2px;
}

.ax_page_body{
  padding:14px 14px 18px;
}

.ax_intro_title{
  margin:0 0 4px;
  font-size:22px;
  line-height:1.2;
  color:var(--ax-brand);
  font-weight:800;
}

.ax_intro_text{
  margin:0;
  color:var(--ax-text-soft);
  font-size:14px;
  line-height:1.45;
}

.ax_notice{
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:12px;
  background:#fafafa;
  border:1px solid #eee;
  color:#333;
  font-size:13px;
  white-space:pre-wrap;
  display:none;
}

.ax_actions_col{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:26px;
}

.ax_actions_row{
  display:flex;
  gap:10px;
}

/* =========================
   BUTTON SYSTEM
========================= */

.ax_btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:var(--ax-btn-h);
  padding:0 16px;
  border-radius:var(--ax-radius-lg);
  border:1px solid var(--ax-border);
  background:#fff;
  color:#333;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  text-align:center;
  line-height:1;
}

.ax_btn:active{
  transform:translateY(1px);
}

.ax_btn_full{
  width:100%;
}

.ax_btn_flex{
  flex:1 1 0;
}

.ax_btn_sm{
  min-height:var(--ax-btn-h-sm);
  border-radius:var(--ax-radius-sm);
}

.ax_btn_lg{
  min-height:var(--ax-btn-h-lg);
}

.ax_btn_green{
  background:var(--ax-brand);
  border-color:var(--ax-brand);
  color:#fff;
  font-weight:800;
}

.ax_btn_white{
  background:#fff;
  border-color:var(--ax-border);
  color:#333;
}

.ax_btn_gray{
  background:var(--ax-gray);
  border-color:#d0d0d0;
  color:#333;
}

.ax_btn_soft_green{
  background:var(--ax-brand-weak);
  border-color:#d3eef0;
  color:#0f4f55;
}

.ax_btn_danger{
  background:var(--ax-danger-bg);
  border-color:var(--ax-danger-border);
  color:var(--ax-danger);
  font-weight:700;
}

.ax_btn_danger_solid{
  background:var(--ax-danger);
  border-color:var(--ax-danger);
  color:#fff;
  font-weight:800;
}

/* =========================
   CARDS / LISTS
========================= */

.ax_card{
  border:1px solid var(--ax-border);
  border-radius:var(--ax-radius-xl);
  overflow:hidden;
  margin:12px 0;
  background:#fff;
}

.ax_card_header_soft{
  padding:13px 14px;
  font-weight:800;
  font-size:15px;
  background:var(--ax-brand-weak);
  border-bottom:1px solid var(--ax-border);
}

.ax_row_between{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px;
}

.ax_company_name{
  font-size:15px;
  font-weight:800;
  color:#222;
  line-height:1.35;
  word-break:break-word;
}

/* =========================
   FORM
========================= */

.ax_input{
  width:100%;
  min-height:48px;
  border:1px solid var(--ax-border);
  border-radius:14px;
  background:#fff;
  padding:0 14px;
  font-size:16px;
  color:#222;
  outline:none;
}

.ax_input:focus{
  border-color:#b8dfe2;
  box-shadow:0 0 0 3px rgba(1,108,116,.08);
}

/* =========================
   LOGIN PAGE
========================= */

.ax_login_page{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  min-height:100%;
  padding:25vh 16px 16px;
  background:#fff;
}

.ax_login_root{
  width:100%;
  max-width:420px;
  margin:0 auto;
  text-align:center;
}

#ax_google_btn{
  display:block;
  width:320px;
  max-width:100%;
  margin:0 auto;
}

/* =========================
   TARGETS / DISCONNECT
========================= */

.ax_folder_btn{
  width:100%;
  text-align:left;
  border:0;
  background:#fff;
  padding:13px 14px 13px 40px;
  border-bottom:1px solid #f0f0f0;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:relative;
}

.ax_folder_btn::before{
  content:"📁";
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-60%);
  font-size:16px;
}

.ax_folder_btn:last-child{
  border-bottom:0;
}

.ax_folder_btn:active{
  transform:translateY(1px);
}

.ax_icon_btn{
  flex:0 0 auto;
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--ax-border);
  background:#fff;
  cursor:pointer;
  font-size:18px;
}

.ax_icon_btn:active{
  transform:translateY(1px);
}

.ax_confirm_box{
  border-top:1px solid var(--ax-border);
  background:var(--ax-danger-bg);
  padding:14px;
}

.ax_confirm_text{
  margin:0 0 12px;
  color:#333;
  font-size:14px;
  line-height:1.45;
  font-weight:700;
}

/* =========================
   SCAN PAGE
========================= */

.ax_scan_root{
  position:fixed;
  inset:0;
  display:flex;
  flex-direction:column;
  background:#fff;
  z-index:1;
}

.ax_top_target_btn{
  width:100%;
  padding:10px 12px;
  border:0;
  background:var(--ax-brand);
  color:#fff;
  font-size:15px;
  font-weight:700;
  text-align:center;
  cursor:pointer;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ax_scan_area{
  flex:1;
  position:relative;
  background:#000;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
}

.ax_video{
  width:100%;
  height:100%;
  object-fit:cover;
  background:#000;
}

.ax_guides{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:5;
}

.ax_gv{
  position:absolute;
  top:0;
  bottom:0;
  width:0;
  border-left:2px dashed rgba(255,255,255,0.35);
}

.ax_gh{
  position:absolute;
  left:0;
  right:0;
  height:0;
  border-top:2px dashed rgba(255,255,255,0.35);
}

.ax_bottom{
  background:#fff;
  border-top:1px solid var(--ax-border);
  padding:10px 12px 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ax_thumbs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
  -webkit-overflow-scrolling:touch;
}

.ax_thumb{
  flex:0 0 auto;
  width:54px;
  height:54px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid #e7e7e7;
  background:#f6f6f6;
  position:relative;
}

.ax_thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.ax_badge{
  position:absolute;
  left:6px;
  top:6px;
  font-size:11px;
  font-weight:800;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(0,0,0,.55);
  color:#fff;
}

.ax_more{
  width:54px;
  height:54px;
  border-radius:10px;
  border:1px solid #e7e7e7;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#333;
  background:#fafafa;
  flex:0 0 auto;
}

.ax_controls_row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.ax_capture_btn{
  flex:0 0 64px;
  width:64px;
  height:64px;
  border-radius:999px;
  border:4px solid #fff;
  background:var(--ax-brand);
  box-shadow:0 6px 18px rgba(0,0,0,.25);
  cursor:pointer;
  position:relative;
  outline:none;
}

.ax_capture_btn > .ax_ring{
  position:absolute;
  inset:9px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  border:2px solid rgba(255,255,255,.7);
}

/* =========================
   OVERLAY / MODAL
========================= */

.ax_overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:20000;
}

.ax_overlay_box{
  background:#fff;
  padding:22px 18px;
  border-radius:14px;
  min-width:260px;
  max-width:85vw;
  box-shadow:var(--ax-shadow);
  text-align:center;
}

.ax_overlay_title{
  font-size:18px;
  font-weight:800;
  margin-bottom:10px;
  color:#0b0b0b;
  line-height:1.3;
  white-space:normal;
}

.ax_overlay_text{
  font-size:14px;
  color:#444;
  margin-bottom:12px;
  line-height:1.35;
  white-space:normal;
  word-break:break-word;
}

.ax_overlay_actions{
  display:flex;
  justify-content:center;
  align-items:stretch;
  gap:10px;
  width:100%;
  margin-top:10px;
}

/* =========================
   DESKTOP FRAME
========================= */

@media (min-width:900px){

  #app{
    width:420px;
    height:820px;
    min-height:0;
    margin:16px auto;
    border:1px solid var(--ax-border);
    border-radius:18px;
    box-shadow:var(--ax-shadow-desktop);
    overflow:hidden;
    background:#fff;
  }

  .ax_page{
    width:100%;
    height:100%;
  }

  .ax_login_page{
    padding:200px 16px 16px;
  }

  body{
    background:var(--ax-bg);
  }
}

/* =========================
   SCAN THUMB PREVIEW
========================= */

.ax_thumb_preview_wrap{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.ax_thumb_preview_image_wrap{
  width:100%;
  max-width:420px;
  margin:0 auto;
  border:1px solid var(--ax-border);
  border-radius:14px;
  overflow:hidden;
  background:#f7f7f7;
}

.ax_thumb_preview_image{
  display:block;
  width:100%;
  height:auto;
  max-height:62vh;
  object-fit:contain;
  background:#f7f7f7;
}

.ax_thumb_preview_actions{
  display:flex;
  gap:10px;
}

.ax_thumb_preview_actions .ax_btn{
  min-height:44px;
}

@media (max-width:480px){
  .ax_thumb_preview_image{
    max-height:56vh;
  }
}

/* =========================
   THUMBS HELP
========================= */

.ax_thumbs_help{
  display:block;
  margin:0;
}

/* =========================
   LOGO AXERA SCAN
========================= */

.ax_login_logo{
  width:280px;
  max-width:80vw;
  display:block;
  margin:0 auto 48px auto;
}