:root {
  --mobile-bg-start: #0b1020;
  --mobile-bg-end: #182748;
  --mobile-card-bg: rgba(255, 255, 255, 0.96);
  --mobile-card-border: rgba(255, 255, 255, 0.22);
  --mobile-primary: #4f7cff;
  --mobile-primary-strong: #355be8;
  --mobile-accent: #15c8ff;
  --mobile-text: #1f2a44;
  --mobile-text-muted: #6f7b95;
}

body.mobile-iphone-dashboard {
  margin: 0;
  background: radial-gradient(circle at top, #2d4f91 0%, var(--mobile-bg-start) 45%, #060a14 100%) !important;
  color: var(--mobile-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.mobile-windowmob-dashboard {
  margin: 0;
  background: radial-gradient(circle at top, #355eab 0%, #0f1a31 45%, #070b14 100%) !important;
  color: var(--mobile-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.mobile-iphone-dashboard a {
  color: var(--mobile-primary-strong);
}

body.mobile-iphone-dashboard > div:first-of-type {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 10px 36px;
}

body.mobile-iphone-dashboard .rounded_lower,
body.mobile-iphone-dashboard .rounded_upper,
body.mobile-iphone-dashboard .outer_content,
body.mobile-iphone-dashboard .block {
  border-radius: 18px !important;
}

body.mobile-iphone-dashboard .outer_content,
body.mobile-iphone-dashboard .block {
  background: var(--mobile-card-bg) !important;
  border: 1px solid var(--mobile-card-border);
  box-shadow: 0 14px 35px rgba(7, 12, 24, 0.3);
}

body.mobile-iphone-dashboard .outer_content {
  padding: 18px !important;
}

body.mobile-iphone-dashboard h1,
body.mobile-iphone-dashboard h2,
body.mobile-iphone-dashboard h3,
body.mobile-iphone-dashboard h4 {
  color: #0f1e3f !important;
  letter-spacing: -0.02em;
}

body.mobile-iphone-dashboard .order_heading h1 {
  font-size: 2.1rem !important;
  line-height: 1.15;
}

body.mobile-iphone-dashboard p,
body.mobile-iphone-dashboard li,
body.mobile-iphone-dashboard label,
body.mobile-iphone-dashboard td,
body.mobile-iphone-dashboard th {
  color: var(--mobile-text);
}

/* Settings/wizard screens: force readable contrast on content blocks. */
body.mobile-iphone-dashboard .outer_block,
body.mobile-iphone-dashboard .settings_section,
body.mobile-iphone-dashboard .wizard_section,
body.mobile-iphone-dashboard .form_settings,
body.mobile-iphone-dashboard #server_settings {
  background: #ffffff !important;
  color: var(--mobile-text) !important;
}

body.mobile-iphone-dashboard .outer_block *,
body.mobile-iphone-dashboard .settings_section *,
body.mobile-iphone-dashboard .wizard_section * {
  color: var(--mobile-text);
}

body.mobile-iphone-dashboard .box_heading,
body.mobile-iphone-dashboard .box_heading_dark {
  background: linear-gradient(135deg, #243a72 0%, #17254a 100%) !important;
  color: #ffffff !important;
}

body.mobile-iphone-dashboard .box_heading h1,
body.mobile-iphone-dashboard .box_heading h2,
body.mobile-iphone-dashboard .box_heading h3,
body.mobile-iphone-dashboard .box_heading_dark h1,
body.mobile-iphone-dashboard .box_heading_dark h2,
body.mobile-iphone-dashboard .box_heading_dark h3 {
  color: #ffffff !important;
}

body.mobile-iphone-dashboard input[type="text"],
body.mobile-iphone-dashboard input[type="email"],
body.mobile-iphone-dashboard input[type="password"],
body.mobile-iphone-dashboard input[type="number"],
body.mobile-iphone-dashboard select,
body.mobile-iphone-dashboard textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d2d9ea;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 42px;
  background: #fff;
  color: #1f2a44;
  box-shadow: inset 0 1px 2px rgba(15, 30, 63, 0.05);
}

body.mobile-iphone-dashboard input[type="text"]:focus,
body.mobile-iphone-dashboard input[type="email"]:focus,
body.mobile-iphone-dashboard input[type="password"]:focus,
body.mobile-iphone-dashboard input[type="number"]:focus,
body.mobile-iphone-dashboard select:focus,
body.mobile-iphone-dashboard textarea:focus {
  outline: none;
  border-color: var(--mobile-primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.16);
}

body.mobile-iphone-dashboard input[type="submit"],
body.mobile-iphone-dashboard input[type="button"],
body.mobile-iphone-dashboard button,
body.mobile-iphone-dashboard .btn {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 600;
  color: #fff !important;
  background: linear-gradient(135deg, var(--mobile-primary) 0%, var(--mobile-accent) 100%) !important;
  box-shadow: 0 10px 24px rgba(53, 91, 232, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

body.mobile-iphone-dashboard input[type="submit"] *,
body.mobile-iphone-dashboard input[type="button"] *,
body.mobile-iphone-dashboard button *,
body.mobile-iphone-dashboard .btn * {
  color: #ffffff !important;
}

body.mobile-iphone-dashboard input[type="submit"]:hover,
body.mobile-iphone-dashboard input[type="button"]:hover,
body.mobile-iphone-dashboard button:hover,
body.mobile-iphone-dashboard .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(53, 91, 232, 0.42);
}

body.mobile-iphone-dashboard input[disabled],
body.mobile-iphone-dashboard button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

body.mobile-iphone-dashboard #signup_service_terms {
  border: 1px solid #dbe6ff !important;
  background: linear-gradient(180deg, #f6f9ff 0%, #edf3ff 100%) !important;
  color: #29437a;
  padding: 14px !important;
}

body.mobile-iphone-dashboard #signup_section_agree {
  border: 1px solid #e3e9f7;
  background: #f8fbff;
  padding: 14px !important;
}

body.mobile-iphone-dashboard #errmsg,
body.mobile-iphone-dashboard .error,
body.mobile-iphone-dashboard .errors {
  border-radius: 12px;
  background: #fff2f3;
  border: 1px solid #ffc7cc;
  color: #9e1e2a;
  padding: 10px 12px;
}

body.mobile-iphone-dashboard table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

body.mobile-iphone-dashboard th {
  background: #f1f5ff;
  color: #233b73;
  font-weight: 600;
}

body.mobile-iphone-dashboard td,
body.mobile-iphone-dashboard th {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2fb;
}

body.mobile-iphone-dashboard .loading_bar {
  border-radius: 12px !important;
}

@media (max-width: 767px) {
  body.mobile-iphone-dashboard > div:first-of-type {
    padding: 10px 8px 24px;
  }

  body.mobile-iphone-dashboard .outer_content {
    padding: 14px !important;
  }

  body.mobile-iphone-dashboard .order_heading h1 {
    font-size: 1.5rem !important;
  }

  body.mobile-iphone-dashboard [style*="float: right"],
  body.mobile-iphone-dashboard [style*="float:right"] {
    float: none !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  body.mobile-iphone-dashboard [style*="width: 350px"],
  body.mobile-windowmob-dashboard [style*="width: 350px"],
  body.mobile-iphone-dashboard [style*="width: 330px"],
  body.mobile-windowmob-dashboard [style*="width: 330px"],
  body.mobile-iphone-dashboard [style*="width: 250px"],
  body.mobile-windowmob-dashboard [style*="width: 250px"],
  body.mobile-iphone-dashboard [style*="width: 200px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.mobile-windowmob-dashboard [style*="width: 200px"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Modal safety: prevents clipped actions and off-screen dialogs on phones. */
@media (max-width: 980px) {
  .giant_config_modal,
  .wizard.giant_config_modal,
  .jqmWindow,
  .file_request_modal {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-height: calc(100vh - 16px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px !important;
  }

  .wizard_container,
  .giant_config_modal .block_content {
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    box-sizing: border-box;
  }

  .giant_config_modal .rounded_lower,
  .wizard .rounded_lower {
    height: auto !important;
    min-height: 56px;
    padding: 6px 8px;
  }

  .giant_config_modal .post_button,
  .wizard .post_button {
    float: none !important;
    display: inline-block !important;
    margin: 6px 6px 0 0 !important;
  }

  .giant_config_modal .post_button a,
  .wizard .post_button a,
  .giant_config_modal input[type="button"],
  .giant_config_modal input[type="submit"],
  .wizard input[type="button"],
  .wizard input[type="submit"],
  .wizard button {
    display: inline-block !important;
    min-height: 40px;
    padding: 8px 12px;
    white-space: normal !important;
  }

  .giant_config_modal table,
  .wizard table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
  }
}
