@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');

:root{
  --bg:#ffffff;
  --ink:#111;
  --border:#8e8e8e;
  --card:#f7f7f7;
  --purple:#6b57a6;
  --purple2:#5b4896;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background: var(--bg);
  font-family: "Kalam", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
}

/* ---------- PAGE ---------- */
.page{
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 22px;
}

.header{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}
.header img{
  width: 100%;
  max-width: 520px;
  height: auto;
}

.screen{ width:100%; }
.hidden{ display:none !important; }

/* ---------- FORM ---------- */
.field{ margin: 14px 0; }

.field-label{
  display:inline-block;
  padding: 0 10px;
  font-size: 20px;
  transform: translateY(10px);
  background: var(--bg);
  color: #3a3a3a;
}
.field-label.purple{ color: var(--purple); }

.select-wrap{
  position: relative;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 44px 14px 14px;
  background: #fff;
}
.select-wrap.purple-outline{
  border: 3px solid var(--purple);
}

select{
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 28px;
  color: #111;
  appearance: none;
}

.chev{
  position:absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #333;
  pointer-events:none;
}

.input-wrap{
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

input{
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 30px;
  background: transparent;
}

.btn-primary{
  width: 100%;
  margin-top: 8px;
  padding: 18px;
  border: none;
  border-radius: 18px;
  background: var(--purple);
  color: #fff;
  font-family: inherit;
  font-size: 30px;
  cursor: pointer;
}
.btn-primary:active{ background: var(--purple2); }

.error{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffe7e7;
  border: 2px solid #ffb3b3;
  color: #7a1a1a;
  font-size: 20px;
}

/* ---------- CARDS ---------- */
.card{
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 2px solid #e0e0e0;
  background: #fafafa;
}
.card h2{
  margin: 0 0 10px;
  font-size: 34px;
}
.card p{
  margin: 10px 0;
  font-size: 26px;
  line-height: 1.25;
}
.small{ font-size: 24px; }
.label{ font-weight:700; }

/* ---------- SMF RESULT LAYOUT ---------- */
.smf-layout{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 8px;
}

/* ---------- TUBE ---------- */
.tube-panel{
  border-radius: 28px;
  overflow: hidden;
}

.tube-block{
  position: relative;
  width: 100%;
  height: 680px;
  border-radius: 28px;
  border: 4px solid rgba(0,0,0,0.12);
  background: #00bcd4;
}

.tube-stripe{
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 100%;
  border-radius: 22px;
  background: #000;
}

.tube-meta{
  margin-top: 10px;
  font-size: 22px;
  color: #333;
}

/* ---------- FIBER LIST ---------- */
.fiber-list{
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.fiber-tile{
  border-radius: 20px;
  padding: 18px;
  font-size: 32px;
  color:#fff;
  display:flex;
  justify-content: space-between;
  align-items:center;
  border: 3px solid rgba(0,0,0,0.12);
}
.fiber-tile.light{ color:#111; }

.fiber-num{
  font-weight: 700;
  font-size: 38px;
}
.fiber-name{
  font-size: 30px;
  opacity: 0.95;
}

/* ---------- HIGHLIGHT ---------- */
.fiber-tile.highlight{
  border: 5px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.fiber-tile.highlight::before{
  content:"";
  position:absolute;
  inset: -8px;
  border-radius: 26px;
  padding: 8px;
  background: linear-gradient(
    90deg,
    #00e5ff,
    #ff00ff,
    #ff0000,
    #ffff00,
    #00ff6a,
    #00e5ff
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events:none;
}

/* ---------- BACK LINK ---------- */
.pca-back{
  margin: 6px 0 14px;
  font-size: 18px;
}
.pca-back a{
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
}
.pca-back a:hover{
  text-decoration: underline;
}

/* ---------- PHONE FIXES ---------- */
@media (max-width: 640px){

  .page{
    padding: 12px;
  }

  .header img{
    max-width: 420px;
  }

  .field{ margin: 10px 0; }

  .field-label{
    font-size: 16px;
    transform: translateY(8px);
  }

  select{ font-size: 22px; }
  input{ font-size: 24px; }

  .btn-primary{
    font-size: 24px;
    padding: 14px;
  }

  .card h2{ font-size: 26px; }
  .card p{ font-size: 19px; }
  .small{ font-size: 18px; }

  /* keep tube + tiles side by side */
  .smf-layout{
    grid-template-columns: 1.05fr 0.95fr;
    gap: 10px;
  }

  .tube-block{
    height: 52vh;
    min-height: 300px;
    max-height: 520px;
  }

  .tube-stripe{
    width: 26%;
  }

  .fiber-list{
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
    gap: 10px;
  }

  .fiber-tile{
    padding: 12px;
    border-radius: 16px;
  }

  .fiber-num{ font-size: 30px; }
  .fiber-name{ font-size: 22px; }
}

