:root{
  --navy:#073d68;
  --navy-dark:#052f51;
  --blue:#0b66aa;
  --blue-light:#1384d1;
  --bg:#f4f7fa;
  --text:#17324a;
  --muted:#728393;
  --line:#dce5eb;
  --white:#fff;
  --shadow:0 10px 30px rgba(8,54,86,.08);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
}

body.menu-open{
  overflow:hidden;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
}

a{
  color:inherit;
}

.hidden{
  display:none!important;
}


/* =========================================================
   AUTH
   ========================================================= */

.auth-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
  background:
    linear-gradient(
      135deg,
      #eef6fb,
      #f8fafc
    );
}

.auth-card{
  width:min(430px,100%);
  background:#fff;
  padding:32px;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:0 20px 55px rgba(8,54,86,.12);
}

.logo{
  width:54px;
  height:54px;
  border-radius:16px;
  background:var(--navy);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:700;
}

.logo.mini{
  width:40px;
  height:40px;
  border-radius:11px;
  flex:0 0 40px;
}

.auth-card h1{
  margin:14px 0 8px;
}

.auth-card p{
  color:var(--muted);
}

label{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin:12px 0;
  font-size:13px;
  font-weight:700;
}

input,
select,
textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  outline:none;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#82b8d9;
  box-shadow:0 0 0 3px rgba(11,102,170,.09);
}

textarea{
  min-height:90px;
  resize:vertical;
}

.primary{
  background:var(--blue);
  color:#fff;
  border:0;
  border-radius:10px;
  padding:11px 15px;
  font-weight:700;
}

.primary:hover{
  background:var(--navy);
}

.primary:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.tabs{
  display:flex;
  gap:6px;
  margin:20px 0;
}

.tab{
  flex:1;
  border:1px solid var(--line);
  background:#fff;
  padding:10px;
  border-radius:10px;
}

.tab.active{
  background:#edf6fc;
  color:var(--blue);
  border-color:#b9d8ed;
}

.auth-card form .primary{
  width:100%;
  margin-top:8px;
}

.notice{
  padding:12px 14px;
  margin-top:14px;
  border-radius:10px;
  background:#eef8f3;
  color:#236645;
  border:1px solid #cfe7da;
}


/* =========================================================
   APP LAYOUT
   ========================================================= */

.app{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  min-height:100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  background:
    linear-gradient(
      180deg,
      #063b66 0%,
      #074d7f 55%,
      #063a62 100%
    );
  color:#fff;
  padding:20px 16px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  z-index:60;
}

.sidebar-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:22px;
}

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

.brand-name{
  font-size:19px;
  font-weight:800;
  letter-spacing:.05em;
  white-space:nowrap;
}

.sidebar-close{
  display:none;
  width:38px;
  height:38px;
  padding:0;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:10px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:24px;
  line-height:1;
}

.sidebar nav{
  display:grid;
  gap:6px;
}

.nav{
  width:100%;
  border:0;
  background:transparent;
  color:#e7f2fa;
  text-align:left;
  padding:13px 14px;
  border-radius:13px;
  font-weight:700;
  transition:
    background .18s ease,
    color .18s ease,
    transform .18s ease;
}

.nav:hover{
  background:rgba(255,255,255,.10);
  color:#fff;
}

.nav.active{
  background:#fff;
  color:var(--navy);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}

.nav-divider{
  height:1px;
  background:rgba(255,255,255,.18);
  margin:12px 6px;
}

.logout{
  margin-top:auto;
  color:#fff;
}

.logout:hover{
  background:rgba(255,255,255,.12);
}

.sidebar-bottom{
  margin-top:auto;
  padding-top:18px;
}


/* =========================================================
   SIDEBAR BACKDROP
   ========================================================= */

.sidebar-backdrop{
  position:fixed;
  inset:0;
  z-index:50;
  background:rgba(8,25,40,.50);
  backdrop-filter:blur(2px);
}


/* =========================================================
   MAIN
   ========================================================= */

main{
  padding:28px 34px 60px;
  min-width:0;
}

header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:22px;
  gap:16px;
}

header h1{
  margin:4px 0 0;
  font-size:28px;
}

header small{
  color:var(--blue);
  font-weight:700;
  letter-spacing:.12em;
}

header>div:last-child{
  display:flex;
  align-items:center;
  gap:12px;
}

.menu-btn{
  display:none;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:var(--navy);
  align-items:center;
  justify-content:center;
  font-size:22px;
}

.user-pill{
  display:flex;
  align-items:center;
  gap:10px;
}


/* =========================================================
   VIEWS
   ========================================================= */

.view{
  display:none;
}

.active-view{
  display:block;
}


/* =========================================================
   HERO
   ========================================================= */

.hero{
  background:
    linear-gradient(
      120deg,
      #095188,
      #1384d1
    );
  color:#fff;
  padding:28px;
  border-radius:21px;
  margin-bottom:18px;
  box-shadow:0 12px 35px rgba(9,81,136,.16);
}

.hero h2{
  margin:0 0 8px;
  font-size:27px;
}

.hero p{
  margin:0;
  color:#e4f4ff;
  max-width:680px;
  line-height:1.55;
}

.hero .primary{
  margin-top:18px;
  background:#fff;
  color:var(--navy);
}

.hero .primary:hover{
  background:#edf6fc;
}


/* =========================================================
   STATS
   ========================================================= */

.stats{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}

.stats>div,
.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:17px;
  box-shadow:var(--shadow);
}

.stats>div{
  padding:20px;
}

.stats span{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:8px;
}

.stats strong{
  font-size:29px;
  color:var(--navy);
}


/* =========================================================
   PANELS
   ========================================================= */

.panel{
  padding:22px;
}

.panel-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
}

.panel h3{
  margin-top:0;
}

.panel p{
  color:var(--muted);
}

.section-intro{
  margin-bottom:18px;
}

.section-intro h2{
  margin:0 0 7px;
}

.section-intro p{
  margin:0;
  color:var(--muted);
}


/* =========================================================
   CARDS
   ========================================================= */

.card{
  padding:15px 0;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
}

.card:last-child{
  border-bottom:0;
}

.card h4{
  margin:0 0 5px;
}

.card p{
  margin:0;
  font-size:13px;
  line-height:1.55;
}

.badge{
  display:inline-flex;
  font-size:11px;
  padding:5px 8px;
  border-radius:999px;
  background:#edf6fc;
  color:var(--blue);
  font-weight:700;
  margin-bottom:7px;
}

.small{
  padding:7px 9px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
}

.inline{
  max-width:420px;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.48);
  display:grid;
  place-items:center;
  padding:18px;
  z-index:100;
  overflow:auto;
}

.modal-card{
  width:min(760px,100%);
  max-height:calc(100vh - 36px);
  overflow:auto;
  background:#fff;
  padding:22px;
  border-radius:20px;
  position:relative;
}

.x{
  position:absolute;
  right:15px;
  top:12px;
  border:0;
  background:transparent;
  font-size:28px;
  color:#777;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.grid label{
  margin:0;
}

.full{
  grid-column:1/-1;
}

.actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.actions button{
  padding:10px 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
}

.actions .primary{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
}


/* =========================================================
   LINKS
   ========================================================= */

a.invite{
  color:var(--blue);
  text-decoration:none;
  font-size:12px;
}

a.invite:hover{
  text-decoration:underline;
}


/* =========================================================
   IMPORT GUESTS
   ========================================================= */

.import-box{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:14px;
  border:1px dashed var(--line);
  border-radius:12px;
  margin:14px 0 18px;
  background:#fbfdff;
}

.import-box h4,
.import-box p{
  margin:0;
}

.import-box p{
  font-size:12px;
}

.import-box input{
  max-width:300px;
}


/* =========================================================
   QR SCANNER
   ========================================================= */

.scanner-box{
  margin:14px 0;
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfdff;
}

#qrVideo{
  width:min(520px,100%);
  border-radius:12px;
  background:#111;
  display:block;
  margin-bottom:10px;
}

.scan-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

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

.qr-thumb{
  width:92px;
  height:92px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}


/* =========================================================
   DESIGNER
   ========================================================= */

.designer-layout{
  display:grid;
  grid-template-columns:320px minmax(0,1fr);
  gap:28px;
  margin-top:20px;
}

.designer-controls{
  min-width:0;
}

.template-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:15px;
}

.template-choice{
  border:1px solid var(--line);
  background:#fff;
  border-radius:11px;
  padding:10px;
  text-align:left;
  display:flex;
  align-items:center;
  gap:8px;
}

.template-choice:hover{
  border-color:#aacbdd;
}

.template-choice.active{
  outline:2px solid var(--blue);
  background:#f3f9fd;
}

.swatch{
  width:24px;
  height:24px;
  border-radius:7px;
  border:1px solid #d7d7d7;
  display:inline-block;
  flex:0 0 24px;
}

.swatch.ivory{
  background:#fff9ec;
}

.swatch.blue{
  background:#0d4f7c;
}

.swatch.floral{
  background:#e8f1e5;
}

.swatch.gold{
  background:#c7a35b;
}

.preview-wrap{
  display:grid;
  place-items:center;
  padding:20px;
  border-radius:16px;
  background:#eef2f5;
  min-height:620px;
}

.invitation-preview{
  width:min(460px,100%);
  min-height:590px;
  padding:58px 42px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border-radius:8px;
  box-shadow:0 18px 45px rgba(0,0,0,.14);
  position:relative;
  overflow:hidden;
  background-size:cover!important;
  background-position:center!important;
}

.invitation-preview h2{
  font-family:Georgia,serif;
  font-size:36px;
  line-height:1.08;
  margin:18px 0;
}

.invite-kicker{
  font-size:11px;
  letter-spacing:.22em;
  font-weight:700;
}

.ornament{
  width:52px;
  height:52px;
  border:1px solid currentColor;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-family:Georgia,serif;
}

.divider{
  width:70px;
  height:1px;
  background:currentColor;
  opacity:.45;
  margin:5px 0 18px;
}

.guest-line{
  font-size:17px;
}

.event-meta{
  display:grid;
  gap:7px;
  margin:20px 0;
  font-size:14px;
}

.invite-footer{
  position:absolute;
  bottom:22px;
  font-size:11px;
  letter-spacing:.16em;
  font-weight:700;
}

.invitation-preview.classic{
  background:#fff9ec;
  color:#594a37;
  border:10px double #d8c9a9;
}

.invitation-preview.modern{
  background:
    linear-gradient(
      145deg,
      #063d68,
      #0b75b7
    );
  color:#fff;
}

.invitation-preview.modern:after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:50%;
  right:-130px;
  top:-100px;
}

.invitation-preview.floral{
  background:
    linear-gradient(
      135deg,
      #f8fbf5,
      #e5eee0
    );
  color:#38533b;
  border:1px solid #9cb19a;
}

.invitation-preview.floral:before,
.invitation-preview.floral:after{
  content:"❧";
  position:absolute;
  font-size:100px;
  opacity:.15;
}

.invitation-preview.floral:before{
  left:-10px;
  top:-15px;
}

.invitation-preview.floral:after{
  right:-10px;
  bottom:-15px;
  transform:rotate(180deg);
}

.invitation-preview.royal{
  background:#172035;
  color:#e7cf92;
  border:8px solid #b99a54;
}

.invitation-preview.royal .divider{
  background:#e7cf92;
}

.color-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.color-grid label{
  font-size:11px;
}

.color-grid input[type=color]{
  padding:3px;
  height:42px;
  width:100%;
}

.design-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 4px;
}

.invitation-preview.has-photo:before{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.28);
  z-index:0;
}

.invitation-preview.has-photo>*{
  position:relative;
  z-index:1;
}


/* =========================================================
   SEND INVITATIONS
   ========================================================= */

.send-toolbar{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:16px;
  align-items:end;
  margin:18px 0;
}

.send-toolbar textarea{
  min-height:90px;
}

.send-actions{
  grid-column:1/-1;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.send-note{
  background:#f3f8fb;
  border:1px solid #d5e5ef;
  border-radius:12px;
  padding:12px 14px;
  font-size:13px;
  margin:12px 0 18px;
  color:#365160;
}

.send-table{
  width:100%;
  border-collapse:collapse;
}

.send-table th,
.send-table td{
  padding:12px 9px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:middle;
}

.send-table th{
  font-size:12px;
  color:#687684;
  background:#fafcfd;
}

.send-table td{
  font-size:13px;
}

.status-pill{
  display:inline-flex;
  padding:5px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  background:#eef1f4;
  color:#53606b;
}

.status-pill.sent{
  background:#e6f6ec;
  color:#267043;
}

.status-pill.attending{
  background:#e8f3ff;
  color:#1768a5;
}

.status-pill.maybe{
  background:#fff4d9;
  color:#8a6515;
}

.status-pill.not-attending{
  background:#fdeaea;
  color:#a33b3b;
}

.wa-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border:0;
  border-radius:8px;
  padding:8px 10px;
  font-weight:700;
  background:#eef8f1;
  color:#18723a;
  cursor:pointer;
}

.wa-btn:hover{
  background:#def1e5;
}

.link-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:8px;
  padding:7px 9px;
  cursor:pointer;
}

.link-btn:hover{
  background:#f5f8fa;
}

.phone-missing{
  font-size:11px;
  color:#a14a4a;
}

.send-empty{
  padding:24px 0;
  color:#6a7680;
}


/* =========================================================
   PRICING
   ========================================================= */

.pricing-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-top:20px;
}

.pricing-card{
  position:relative;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:24px;
  box-shadow:var(--shadow);
}

.pricing-card.featured{
  border:2px solid var(--blue);
  transform:translateY(-4px);
}

.pricing-badge{
  position:absolute;
  top:-12px;
  right:18px;
  padding:6px 10px;
  border-radius:999px;
  background:var(--blue);
  color:#fff;
  font-size:11px;
  font-weight:700;
}

.pricing-card h3{
  margin:0 0 8px;
  color:var(--navy);
}

.pricing-price{
  margin:18px 0;
  font-size:25px;
  font-weight:800;
  color:var(--navy);
}

.pricing-card ul{
  margin:16px 0 22px;
  padding-left:20px;
  color:#536574;
  line-height:1.8;
}

.pricing-card .primary{
  width:100%;
}


/* =========================================================
   ACCOUNT
   ========================================================= */

.account-card{
  display:flex;
  align-items:center;
  gap:18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:24px;
  box-shadow:var(--shadow);
  max-width:680px;
}

.account-avatar,
#accountInitial{
  width:72px;
  height:72px;
  flex:0 0 72px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:
    linear-gradient(
      135deg,
      var(--navy),
      var(--blue-light)
    );
  color:#fff;
  font-size:28px;
  font-weight:800;
}

.account-details h3{
  margin:0 0 6px;
}

.account-details p{
  margin:0;
  color:var(--muted);
}

.account-note{
  margin-top:18px;
  padding:14px;
  border-radius:12px;
  background:#f7fafc;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}


/* =========================================================
   HELP & SUPPORT
   ========================================================= */

.help-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:15px;
  margin-top:18px;
}

.help-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:19px;
  box-shadow:0 6px 20px rgba(8,54,86,.05);
}

.help-card h4{
  margin:0 0 8px;
  color:var(--navy);
}

.help-card p{
  margin:0;
  font-size:13px;
  line-height:1.6;
  color:var(--muted);
}

.support-box{
  margin-top:18px;
  background:#edf6fc;
  border:1px solid #cde3f1;
  border-radius:15px;
  padding:18px;
}

.support-box h3{
  margin-top:0;
}

.support-box p{
  margin-bottom:0;
}


/* =========================================================
   PRINT INVITATION
   ========================================================= */

@media print{

  body *{
    visibility:hidden!important;
  }

  #cardPreview,
  #cardPreview *{
    visibility:visible!important;
  }

  #cardPreview{
    position:absolute;
    left:0;
    top:0;
    width:148mm;
    height:210mm;
    box-shadow:none;
    border-radius:0;
    margin:0;
  }

}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:1200px){

  .stats{
    grid-template-columns:repeat(3,1fr);
  }

  .pricing-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .help-grid{
    grid-template-columns:repeat(2,1fr);
  }

}


@media(max-width:950px){

  .app{
    display:block;
  }

  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:min(340px,88vw);
    height:100vh;
    transform:translateX(-105%);
    transition:transform .24s ease;
    box-shadow:18px 0 45px rgba(0,0,0,.18);
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .sidebar-close{
    display:flex;
  }

  .menu-btn{
    display:flex;
  }

  main{
    padding:22px 22px 50px;
  }

  .designer-layout{
    grid-template-columns:1fr;
  }

  .preview-wrap{
    min-height:auto;
  }

  .send-toolbar{
    grid-template-columns:1fr;
  }

  .send-table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }

}


@media(max-width:700px){

  main{
    padding:18px 14px 42px;
  }

  header{
    align-items:center;
  }

  header h1{
    font-size:23px;
  }

  header small{
    font-size:10px;
  }

  .user-pill{
    display:none;
  }

  .hero{
    padding:22px;
    border-radius:17px;
  }

  .hero h2{
    font-size:23px;
  }

  .stats{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .stats>div{
    padding:16px;
  }

  .stats strong{
    font-size:25px;
  }

  .panel{
    padding:17px;
  }

  .panel-head{
    flex-direction:column;
  }

  .grid{
    grid-template-columns:1fr;
  }

  .full{
    grid-column:auto;
  }

  .pricing-grid{
    grid-template-columns:1fr;
  }

  .pricing-card.featured{
    transform:none;
  }

  .help-grid{
    grid-template-columns:1fr;
  }

  .account-card{
    align-items:flex-start;
  }

}


@media(max-width:520px){

  .sidebar{
    width:88vw;
  }

  .brand-name{
    font-size:18px;
  }

  .hero{
    padding:20px 17px;
  }

  .stats{
    grid-template-columns:1fr 1fr;
  }

  .template-grid{
    grid-template-columns:1fr;
  }

  .color-grid{
    grid-template-columns:1fr;
  }

  .invitation-preview{
    min-height:520px;
    padding:42px 24px;
  }

  .invitation-preview h2{
    font-size:30px;
  }

  .account-card{
    flex-direction:column;
  }

  .modal{
    padding:10px;
  }

  .modal-card{
    padding:19px 16px;
    border-radius:16px;
  }

}


@media(max-width:390px){

  .stats{
    grid-template-columns:1fr;
  }

}
