:root{
  --mg-primary:#0f766e;
  --mg-primary-2:#14b8a6;
  --mg-accent:#f59e0b;
  --mg-dark:#0f172a;
  --mg-text:#1f2937;
  --mg-muted:#6b7280;
  --mg-line:#e5e7eb;
  --mg-soft:#f8fafc;
  --mg-card:#ffffff;
  --mg-radius:22px;
  --mg-shadow:0 16px 40px rgba(15,23,42,.08);
}

.mg-services-hub,
.mg-service-form,
.mg-service-form *,
.mg-admin,
.mg-admin *{
  box-sizing:border-box;
}

.mg-services-hub,
.mg-service-form{
  direction:rtl;
  color:var(--mg-text);
  font-family:inherit;
}

.mg-services-hub{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin:26px 0 30px;
}

.mg-service-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:145px;
  padding:22px 20px;
  border:1px solid rgba(20,184,166,.14);
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fffd 100%);
  box-shadow:0 14px 34px rgba(15,23,42,.06);
  text-decoration:none!important;
  color:var(--mg-dark)!important;
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mg-service-card::before{
  content:"";
  position:absolute;
  inset:0 auto auto 0;
  width:100%;
  height:5px;
  background:linear-gradient(90deg,var(--mg-primary),var(--mg-primary-2),var(--mg-accent));
  opacity:.9;
}

.mg-service-card::after{
  content:"↗";
  position:absolute;
  left:18px;
  top:16px;
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:rgba(20,184,166,.1);
  color:var(--mg-primary);
  font-size:18px;
  font-weight:800;
}

.mg-service-card strong{
  display:block;
  font-size:20px;
  line-height:1.6;
  color:var(--mg-dark);
}

.mg-service-card span{
  color:var(--mg-muted);
  font-size:13px;
  line-height:2;
}

.mg-service-card:hover{
  transform:translateY(-5px);
  box-shadow:0 22px 46px rgba(15,23,42,.11);
  border-color:rgba(20,184,166,.3);
}

.mg-service-form{
  position:relative;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid #e6eef5;
  border-radius:28px;
  padding:26px;
  margin:30px 0;
  box-shadow:var(--mg-shadow);
  overflow:hidden;
}

.mg-service-form::before{
  content:"";
  position:absolute;
  top:0;
  right:0;
  left:0;
  height:6px;
  background:linear-gradient(90deg,var(--mg-primary),var(--mg-primary-2),var(--mg-accent));
}

.mg-service-form h2{
  margin:0 0 18px;
  font-size:30px;
  line-height:1.5;
  color:var(--mg-dark);
  font-weight:900;
}

.mg-section{
  background:linear-gradient(180deg,#fcfffe 0%,#f8fafc 100%);
  border:1px solid #e7edf3;
  border-radius:22px;
  padding:18px;
  margin-bottom:18px;
}

.mg-section h3{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:18px;
  margin:0 0 16px;
  color:var(--mg-dark);
}

.mg-section h3::before{
  content:"";
  width:11px;
  height:11px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--mg-primary),var(--mg-primary-2));
  flex:0 0 auto;
  box-shadow:0 0 0 6px rgba(20,184,166,.10);
}

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

.mg-grid label,
.mg-service-form label{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:13px;
  font-weight:800;
  color:#334155;
}

.mg-service-form input,
.mg-service-form select,
.mg-service-form textarea{
  width:100%;
  border:1px solid #d7e0ea !important;
  border-radius:16px;
  padding:13px 14px;
  background:#ffffff !important;
  color:#0f172a !important;
  min-height:50px;
  font:inherit;
  line-height:1.7;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  -webkit-text-fill-color:#0f172a !important;
  caret-color:#0f172a;
}

.mg-service-form textarea{
  min-height:120px;
  resize:vertical;
}

.mg-service-form input::placeholder,
.mg-service-form textarea::placeholder{
  color:#94a3b8 !important;
}

.mg-service-form input:focus,
.mg-service-form select:focus,
.mg-service-form textarea:focus,
.mg-service-form input:active,
.mg-service-form select:active,
.mg-service-form textarea:active{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:rgba(20,184,166,.65) !important;
  box-shadow:0 0 0 4px rgba(20,184,166,.12) !important;
  transform:translateY(-1px);
}

.mg-service-form input::selection,
.mg-service-form textarea::selection{
  background:#c7f9f0;
  color:#0f172a;
}

.mg-service-form select option{
  background:#ffffff;
  color:#0f172a;
}

.mg-service-form input:-webkit-autofill,
.mg-service-form input:-webkit-autofill:hover,
.mg-service-form input:-webkit-autofill:focus,
.mg-service-form textarea:-webkit-autofill,
.mg-service-form select:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color:#0f172a !important;
  transition:background-color 9999s ease-in-out 0s;
}

.mg-check{
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start;
  gap:10px!important;
  min-height:52px;
  background:#ffffff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:12px 14px;
}

.mg-check input{
  width:18px!important;
  height:18px!important;
  min-height:auto!important;
  margin:0;
  accent-color:var(--mg-primary);
}

.mg-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:16px;
}

.mg-actions button{
  border:0;
  border-radius:16px;
  padding:14px 20px;
  font-weight:900;
  font-size:15px;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.mg-actions button:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(15,23,42,.14)}
.mg-actions button:active{transform:translateY(0)}

.mg-calc{
  background:linear-gradient(135deg,var(--mg-dark),#1e293b);
  color:#fff;
}

.mg-submit{
  background:linear-gradient(135deg,var(--mg-accent),#fbbf24);
  color:#111827;
}

.mg-result{
  display:none;
  margin:18px 0;
  padding:16px 18px;
  border-radius:18px;
  line-height:2;
  border:1px solid #bfdbfe;
  background:linear-gradient(180deg,#eff6ff 0%,#f8fbff 100%);
  color:#1e3a8a;
}

.mg-result strong{font-size:18px;color:#0f172a}

.mg-result.mg-error{
  display:block;
  background:linear-gradient(180deg,#fff5f5 0%,#fffafa 100%);
  color:#991b1b;
  border-color:#fecaca;
}

.mg-result.mg-ok{
  display:block;
  background:linear-gradient(180deg,#ecfdf5 0%,#f7fffb 100%);
  color:#065f46;
  border-color:#a7f3d0;
}

.mg-warning{
  background:linear-gradient(180deg,#fff7ed 0%,#fffbf5 100%);
  border:1px solid #fed7aa;
  color:#9a3412;
  padding:14px 16px;
  border-radius:16px;
  line-height:2;
  font-weight:700;
}

.mg-service-form details{
  margin-top:14px;
  background:#ffffff;
  border:1px dashed #d8e1ea;
  border-radius:16px;
  padding:14px 16px;
}

.mg-service-form details summary{
  cursor:pointer;
  font-weight:900;
  color:var(--mg-primary);
}

.mg-service-form details p{
  margin:12px 0 0;
  color:var(--mg-muted);
  line-height:2;
}

/* Admin */
.mg-admin .mg-admin-card{
  background:#fff;
  border:1px solid #e5edf3;
  border-radius:22px;
  padding:20px;
  margin-top:20px;
  box-shadow:0 10px 30px rgba(15,23,42,.06);
}

.mg-admin h1{
  margin-top:16px;
  font-weight:900;
  color:var(--mg-dark);
}

.mg-admin h2{
  margin:0 0 16px;
  font-size:20px;
  font-weight:900;
  color:var(--mg-dark);
}

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

.mg-admin .mg-admin-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.mg-admin .mg-admin-field label,
.mg-admin > form > label,
.mg-admin .mg-check{
  font-weight:700;
  color:#334155;
}

.mg-admin input[type="text"],
.mg-admin input[type="number"],
.mg-admin input[type="email"],
.mg-admin textarea,
.mg-admin select{
  width:100%;
  border:1px solid #d7e0ea !important;
  border-radius:14px;
  min-height:44px;
  padding:10px 12px;
  background:#fff !important;
  color:#0f172a !important;
  box-shadow:none;
}

.mg-admin input[type="text"]:focus,
.mg-admin input[type="number"]:focus,
.mg-admin input[type="email"]:focus,
.mg-admin textarea:focus,
.mg-admin select:focus{
  border-color:rgba(20,184,166,.65) !important;
  box-shadow:0 0 0 4px rgba(20,184,166,.12) !important;
  outline:none;
}

.mg-admin textarea{min-height:140px}

.mg-admin .button.button-primary{
  border:none;
  background:linear-gradient(135deg,var(--mg-primary),var(--mg-primary-2));
  color:#fff;
  border-radius:14px;
  padding:8px 18px;
  min-height:42px;
  box-shadow:0 8px 18px rgba(20,184,166,.22);
}

.mg-admin .mg-check{
  margin-top:14px;
}

@media(max-width:1100px){
  .mg-services-hub{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mg-admin .mg-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:900px){
  .mg-grid{grid-template-columns:1fr}
}

@media(max-width:640px){
  .mg-services-hub{grid-template-columns:1fr}
  .mg-service-form{padding:18px;border-radius:22px}
  .mg-service-form h2{font-size:24px}
  .mg-admin .mg-admin-grid{grid-template-columns:1fr}
  .mg-actions{flex-direction:column}
  .mg-actions button{width:100%}
}

.mg-checkout{
  background:linear-gradient(135deg,#0f766e,#14b8a6);
  color:#fff;
}
.mg-checkout:disabled{
  opacity:.45;
  cursor:not-allowed;
  box-shadow:none!important;
  transform:none!important;
}

/* v1.2.2: checkbox and file-upload readability fix */
.mg-service-form input[type="checkbox"]{
  appearance:auto !important;
  -webkit-appearance:checkbox !important;
  -moz-appearance:checkbox !important;
  width:22px !important;
  height:22px !important;
  min-width:22px !important;
  min-height:22px !important;
  padding:0 !important;
  border:2px solid #0f766e !important;
  border-radius:6px !important;
  background:#fff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  box-shadow:0 0 0 3px rgba(20,184,166,.10) !important;
  cursor:pointer;
}
.mg-service-form input[type="checkbox"]:checked{
  accent-color:#0f766e;
}
.mg-service-form input[type="file"]{
  padding:10px 12px !important;
  cursor:pointer;
}
.mg-service-form input[type="file"]::file-selector-button{
  border:none;
  border-radius:10px;
  padding:8px 12px;
  margin-left:10px;
  background:linear-gradient(135deg,#0f766e,#14b8a6);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.mg-help{
  margin:12px 0 0;
  color:#64748b;
  font-size:13px;
  line-height:2;
}
