:root{
  --font:-apple-system,BlinkMacSystemFont,system-ui,"Segoe UI",sans-serif;
  --navy:#17153b;
  --gold:#f4b73a;
  --gold-soft:#f8d77d;
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:var(--font);
}

body{
  background:#f3f4f8;
  color:#111827;
}

.app-header{
  max-width:1100px;
  margin:24px auto 8px auto;
  padding:0 12px;
}
.app-header h1{
  font-size:1.4rem;
  font-weight:700;
}
.app-header p{
  margin-top:4px;
  font-size:0.9rem;
  color:#6b7280;
}

.app-container{
  max-width:1100px;
  margin:0 auto 32px auto;
  padding:0 12px 12px;
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,1.1fr);
  gap:16px;
}
@media(max-width:900px){
  .app-container{
    grid-template-columns:1fr;
  }
}

.form-section,.preview-section{
  background:#ffffff;
  border-radius:22px;
  box-shadow:0 18px 40px rgba(15,23,42,0.12);
  padding:18px 18px 20px;
}
.form-section h2,.preview-section h2{
  font-size:1rem;
  font-weight:600;
  margin-bottom:10px;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 14px;
}
.form-grid label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:0.85rem;
}
.form-grid input{
  border:1px solid #d1d5db;
  border-radius:9px;
  padding:6px 8px;
  font-size:0.9rem;
}
.form-grid label:nth-last-child(-n+2){
  grid-column:1 / -1;
}

.buttons{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
button{
  border:none;
  border-radius:999px;
  padding:7px 16px;
  font-size:0.9rem;
  cursor:pointer;
}
#updateCardBtn{
  background:#111827;
  color:#fff;
}
#printCardBtn{
  background:#e5e7eb;
  color:#111827;
}

/* PREVIEW CARD */
.sc-card{
  width:100%;
  max-width:960px;
  border-radius:22px;
  overflow:hidden;
  background:
    linear-gradient(135deg,rgba(148,163,184,0.10) 25%,transparent 25%,transparent 50%,rgba(148,163,184,0.10) 50%,rgba(148,163,184,0.10) 75%,transparent 75%,transparent) 0 0/42px 42px,
    #ffffff;
  box-shadow:0 18px 40px rgba(15,23,42,0.26);
  position:relative;
}

/* HEADER */
.sc-header{
  padding:14px 22px 10px;
  background:linear-gradient(135deg,var(--navy),#241b63);
  color:#ffffff;
}
.sc-header-main{
  display:flex;
  align-items:center;
  gap:14px;
}
.sc-logo-wrap{
  width:64px;
  height:64px;
  border-radius:50%;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.sc-logo-wrap img{
  width:90%;
  height:90%;
  object-fit:contain;
}
.sc-header-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.sc-institute{
  font-size:1.05rem;
  font-weight:800;
  text-transform:uppercase;
}
.sc-location{
  font-size:0.8rem;
  opacity:0.8;
}
.sc-header-band{
  margin-top:8px;
  display:inline-block;
  padding:4px 14px;
  border-radius:999px;
  background:#262450;
  font-size:0.8rem;
  font-weight:700;
}

/* BODY */
.sc-body{
  display:grid;
  grid-template-columns:1.55fr 1.05fr;
  padding:16px 22px 14px;
  gap:18px;
}
@media(max-width:700px){
  .sc-body{
    grid-template-columns:1fr;
  }
}
.sc-info{
  font-size:0.95rem;
}
.sc-row{
  display:grid;
  grid-template-columns:80px 10px 1fr;
  margin-bottom:4px;
}
.sc-row .label{
  font-weight:700;
}
.sc-row .value{
  text-transform:uppercase;
}

/* PHOTO */
.sc-photo{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
}
.sc-photo-frame{
  width:170px;
  height:220px;
  border-radius:22px;
  border:4px solid #1e4bb8;
  overflow:hidden;
  background:#e5e7eb;
}
.sc-photo-frame img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* FOOTER */
.sc-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px 14px;
}
.sc-footer-strip{
  height:18px;
  width:46%;
  border-radius:999px;
  background:#17153b;
}
.sc-footer-year{
  font-size:0.9rem;
  font-weight:700;
  letter-spacing:.08em;
  color:#17153b;
}

/* PRINT: only card */
@media print{
  body *{visibility:hidden;}
  #card,#card *{visibility:visible;}
  #card{
    position:absolute;
    inset:0;
    margin:auto;
    box-shadow:none;
  }
}
