.fgw-modal {
   position: fixed;
   inset: 0;
   z-index: 10000;
   display: none;
   align-items: center;
   justify-content: center;
   padding: 24px;
}

.fgw-modal.is-open {
   display: flex;
}

.fgw-backdrop {
   position: absolute;
   inset: 0;
   background: rgba(8, 10, 12, 0.72);
   backdrop-filter: blur(12px);
}

.fgw-dialog {
   position: relative;
   width: min(960px, 100%);
   max-height: min(820px, calc(100vh - 32px));
   overflow: auto;
   border: 1px solid rgba(255, 255, 255, 0.16);
   border-radius: 8px;
   background: #101416;
   box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.fgw-shell {
   padding: 28px;
   color: #f4f7f5;
}

.fgw-close {
   position: absolute;
   top: 14px;
   right: 14px;
   z-index: 2;
   width: 36px;
   height: 36px;
   border: 0;
   border-radius: 50%;
   color: #f4f7f5;
   background: rgba(255, 255, 255, 0.1);
   font-size: 24px;
   line-height: 36px;
}

.fgw-head {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 20px;
   margin-bottom: 22px;
}

.fgw-kicker {
   display: block;
   margin-bottom: 8px;
   color: #97e1bf;
   font-size: 12px;
   font-weight: 700;
   letter-spacing: 0;
   text-transform: uppercase;
}

.fgw-head h3 {
   margin: 0;
   color: #fff;
   font-size: 34px;
   line-height: 1.05;
}

.fgw-balance {
   flex: 0 0 auto;
   padding: 10px 14px;
   border: 1px solid rgba(255, 255, 255, 0.14);
   border-radius: 8px;
   color: #cfd8d3;
   background: rgba(255, 255, 255, 0.06);
}

.fgw-balance b {
   color: #fff;
}

.fgw-alert {
   margin-bottom: 16px;
   padding: 12px 14px;
   border-radius: 8px;
   color: #231b08;
   background: #f8d783;
}

.fgw-alert.is-error {
   color: #fff;
   background: #b43a3a;
}

.fgw-step {
   display: none;
}

.fgw-step.is-active {
   display: block;
}

.fgw-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 16px;
}

.fgw-upload {
   position: relative;
   display: block;
   min-height: 260px;
   overflow: hidden;
   border: 1px dashed rgba(255, 255, 255, 0.28);
   border-radius: 8px;
   background: rgba(255, 255, 255, 0.05);
   cursor: pointer;
}

.fgw-upload:hover,
.fgw-upload.is-drag {
   border-color: #97e1bf;
   background: rgba(151, 225, 191, 0.12);
}

.fgw-upload input {
   position: absolute;
   width: 1px;
   height: 1px;
   opacity: 0;
   pointer-events: none;
}

.fgw-upload img {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   object-fit: contain;
   background: #0b0e10;
}

.fgw-upload-empty {
   position: absolute;
   inset: 0;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 20px;
   text-align: center;
   color: #cfd8d3;
}

.fgw-upload-empty strong {
   display: block;
   margin-bottom: 6px;
   color: #fff;
   font-size: 18px;
}

.fgw-upload-empty small {
   color: #9ca9a3;
   font-size: 13px;
}

.fgw-fields {
   display: grid;
   grid-template-columns: minmax(0, 1fr) 220px;
   gap: 14px;
   margin-top: 16px;
}

.fgw-fields label {
   display: grid;
   gap: 8px;
   margin: 0;
}

.fgw-fields span {
   color: #cfd8d3;
   font-size: 13px;
   font-weight: 700;
}

.fgw-fields input,
.fgw-fields select,
.fgw-fields textarea {
   width: 100%;
   border: 1px solid rgba(255, 255, 255, 0.16);
   border-radius: 8px;
   outline: none;
   color: #fff;
   background: rgba(255, 255, 255, 0.07);
   padding: 12px 13px;
   font-size: 15px;
}

.fgw-fields textarea {
   resize: vertical;
}

.fgw-fields input:focus,
.fgw-fields select:focus,
.fgw-fields textarea:focus {
   border-color: #97e1bf;
   box-shadow: 0 0 0 3px rgba(151, 225, 191, 0.16);
}

.fgw-field-wide {
   grid-column: 1 / -1;
}

.fgw-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   margin-top: 18px;
}

.fgw-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-height: 46px;
   padding: 12px 18px;
   border: 1px solid rgba(255, 255, 255, 0.18);
   border-radius: 8px;
   color: #fff;
   background: rgba(255, 255, 255, 0.08);
   font-weight: 700;
   text-decoration: none;
   transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.fgw-btn:hover {
   transform: translateY(-1px);
   border-color: rgba(151, 225, 191, 0.55);
   color: #fff;
   background: rgba(151, 225, 191, 0.16);
}

.fgw-btn-primary {
   border-color: #97e1bf;
   color: #0e1712;
   background: #97e1bf;
}

.fgw-btn-primary:hover {
   color: #0e1712;
   background: #b5f0d1;
}

.fgw-progress-visual {
   display: grid;
   gap: 18px;
   place-items: center;
   padding: 38px 0 18px;
}

.fgw-progress-image {
   width: min(520px, 100%);
   aspect-ratio: 16 / 10;
   border-radius: 8px;
   overflow: hidden;
   background: linear-gradient(135deg, rgba(151, 225, 191, 0.12), rgba(255, 255, 255, 0.05));
}

.fgw-progress-image img {
   width: 100%;
   height: 100%;
   object-fit: contain;
}

.fgw-progress-line {
   width: min(520px, 100%);
   height: 8px;
   overflow: hidden;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.12);
}

.fgw-progress-line span {
   display: block;
   width: 0;
   height: 100%;
   border-radius: inherit;
   background: linear-gradient(90deg, #97e1bf, #d7ff7e);
   transition: width 0.35s ease;
}

.fgw-status {
   margin: 0;
   color: #cfd8d3;
   text-align: center;
}

.fgw-payment h4 {
   margin: 0 0 14px;
   color: #fff;
   font-size: 24px;
}

.fgw-tariffs {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
   gap: 12px;
}

.fgw-tariff {
   display: grid;
   gap: 6px;
   padding: 16px;
   border: 1px solid rgba(255, 255, 255, 0.14);
   border-radius: 8px;
   color: #fff;
   background: rgba(255, 255, 255, 0.06);
   text-align: left;
}

.fgw-tariff strong {
   font-size: 18px;
}

.fgw-tariff span {
   color: #97e1bf;
   font-weight: 700;
}

.fgw-payment-status {
   min-height: 22px;
   margin-top: 14px;
   color: #cfd8d3;
}

.fgw-result {
   display: grid;
   place-items: center;
   border-radius: 8px;
   background: #0b0e10;
}

.fgw-result img {
   display: block;
   max-width: 100%;
   max-height: 58vh;
   object-fit: contain;
   border-radius: 8px;
}

.fgw-history {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
   gap: 10px;
   margin-top: 18px;
}

.fgw-history img {
   width: 100%;
   aspect-ratio: 1 / 1;
   border-radius: 8px;
   object-fit: cover;
   background: #0b0e10;
}

body.fgw-modal-open {
   overflow: hidden;
}

@media (max-width: 760px) {
   .fgw-modal {
      padding: 10px;
   }

   .fgw-shell {
      padding: 22px 16px;
   }

   .fgw-head {
      display: grid;
   }

   .fgw-head h3 {
      font-size: 27px;
   }

   .fgw-grid,
   .fgw-fields {
      grid-template-columns: 1fr;
   }

   .fgw-upload {
      min-height: 210px;
   }
}
