/* ===============================
   IRANSans Font (Local)
================================ */
@font-face {
  font-family: 'IRANSans';
  src: url('IRANSansWeb.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===============================
   iOS Theme Variables
================================ */
:root{
  --bg1:#f6f7fb;
  --bg2:#eef1ff;
  --bg3:#ffffff;

  --text:#0b0f1a;
  --muted:rgba(11,15,26,.55);

  --card: rgba(255,255,255,.75);
  --line: rgba(15,23,42,.10);

  --shadow: 0 12px 35px rgba(15,23,42,.10);
  --shadow2: 0 8px 22px rgba(15,23,42,.08);

  --r: 20px;
  --r2: 16px;

  --blue:#0a84ff;
  --green:#34c759;
  --red:#ff3b30;

  --focus: 0 0 0 4px rgba(10,132,255,.18);
}

/* ===============================
   Reset & Base
================================ */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: 'IRANSans', system-ui, -apple-system, "SF Pro Display","SF Pro Text","Segoe UI", Roboto, Arial;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(10,132,255,.14), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(255,149,0,.12), transparent 60%),
    radial-gradient(900px 600px at 55% 95%, rgba(52,199,89,.10), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg1) 45%, var(--bg3));
}

/* ===============================
   Layout
================================ */
.bg-blur{
  position:fixed; inset:0;
  pointer-events:none;
  backdrop-filter: blur(10px);
  opacity:.3;
}

.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

/* ===============================
   Header / Topbar
================================ */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 12px 0 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.logo{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(10,132,255,.18), rgba(10,132,255,.10));
  border:1px solid var(--line);
  box-shadow: var(--shadow2);
  font-weight:900;
}

.title{
  font-weight:900;
  font-size:15px;
}

.subtitle{
  font-size:12.5px;
  color:var(--muted);
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:60vw;
}

.chip{
  text-decoration:none;
  color:var(--text);
  background:rgba(255,255,255,.75);
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:999px;
  font-size:13px;
  box-shadow:var(--shadow2);
  transition:.15s ease;
}
.chip:hover{ transform:translateY(-1px); }

/* ===============================
   Card
================================ */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:16px;
}

/* ===============================
   Typography
================================ */
.h1{
  margin:0 0 12px;
  font-size:18px;
}
.h2{
  margin:0 0 10px;
  font-size:15px;
}

.small{ font-size:12.5px; }
.dim{ color:var(--muted); }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* ===============================
   Grid & Split
================================ */
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width:900px){
  .grid,.split{ grid-template-columns:1fr; }
}

/* ===============================
   Form
================================ */
.field label{
  display:block;
  font-size:12.5px;
  color:var(--muted);
  margin-bottom:8px;
}

.input,
.textarea{
  width:100%;
  border-radius:var(--r2);
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.9);
  padding:12px;
  font-family:inherit;
  font-size:14px;
  outline:none;
  transition:.15s ease;
}

.input:focus,
.textarea:focus{
  border-color:rgba(10,132,255,.35);
  box-shadow:var(--focus);
}

.textarea{
  min-height:210px;
  resize:vertical;
}

.pin-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.hint{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
}

/* ===============================
   Buttons
================================ */
.actions{
  display:flex;
  gap:10px;
  margin-top:14px;
  flex-wrap:wrap;
}

.btn{
  border-radius:999px;
  padding:11px 14px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(255,255,255,.8);
  font-family:inherit;
  font-weight:800;
  cursor:pointer;
  box-shadow:var(--shadow2);
  transition:.15s ease;
}
.btn:hover{ transform:translateY(-1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn-primary{
  background:linear-gradient(180deg, #0a84ff, #007aff);
  color:white;
}
.btn-danger{
  background:linear-gradient(180deg, #ff453a, #ff3b30);
  color:white;
}
.btn-secondary{
  background:rgba(255,255,255,.9);
}
.btn-ghost{
  background:transparent;
  box-shadow:none;
}

/* ===============================
   Alerts
================================ */
.alert{
  margin:10px 0 14px;
  padding:12px;
  border-radius:var(--r);
  border:1px solid var(--line);
  background:rgba(255,255,255,.85);
}
.alert-success{
  border-color:rgba(52,199,89,.35);
  background:rgba(52,199,89,.12);
}
.alert-danger{
  border-color:rgba(255,59,48,.35);
  background:rgba(255,59,48,.12);
}

/* ===============================
   Output Box
================================ */
.output{
  min-height:210px;
  padding:12px;
  border-radius:var(--r);
  border:1px dashed rgba(15,23,42,.18);
  background:rgba(255,255,255,.9);
  white-space:pre-wrap;
  word-break:break-word;
}

/* ===============================
   Footer
================================ */
.footer{
  margin-top:14px;
  text-align:center;
  font-size:12px;
  color:var(--muted);
}

/* ===============================
   Mobile Fixes
================================ */
@media (max-width:520px){

  .container{ padding:14px; }
  .card{ padding:14px; }

  .btn{ width:100%; }

  /* PIN layout fix */
  .pin-row .input{
    width:70%;
    flex:0 0 70%;
  }
  .pin-row .btn{
    width:30%;
    flex:0 0 30%;
    font-size:13px;
    padding-left:8px;
    padding-right:8px;
  }
}

