/* ==========================================================
   Miyahuna - Bill Payment Page Styles
   ========================================================== */
:root {
  --primary-green: #42AB3E;
  --primary-green-dark: #379A34;
  --primary-green-hover: #328E2F;
  --accent-blue: #0088CC;
  --accent-blue-dark: #0072AC;
  --banner-green: rgba(59, 174, 55, 0.88);
  --text-dark: #111111;
  --text-gray: #666666;
  --border-light: #E5E5E5;
  --border-select: #D3D3D3;
  --bg-select: #F1F1F3;
  --bg-white: #FFFFFF;
  
  --font-main: "Cairo", "Tajawal", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: 0.25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  direction: rtl;
  font-family: var(--font-main);
  background-color: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  outline: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================
   Top Utility Bar
   ========================================================== */
.top-utility-bar {
  width: 100%;
  height: 38px;
  background-color: #FFFFFF;
  border-bottom: 1px solid #F0F0F0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.utility-container {
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* In RTL, this positions the group on the far left */
}

.utility-left-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.utility-login-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #666666;
  margin-left: 6px;
  transition: color var(--transition);
}

.utility-login-link:hover {
  color: var(--primary-green);
}

.utility-search-btn {
  width: 32px;
  height: 30px;
  background-color: var(--primary-green);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.utility-search-btn:hover {
  background-color: var(--primary-green-dark);
}

.utility-lang-btn {
  height: 30px;
  padding: 0 12px;
  background-color: var(--primary-green);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.utility-lang-btn:hover {
  background-color: var(--primary-green-dark);
}

/* ==========================================================
   Payment Header
   ========================================================== */
.payment-header {
  width: 100%;
  height: 70px;
  background-color: var(--bg-white);
  border-bottom: 1px solid #ECECEC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-container {
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-right {
  display: flex;
  align-items: center;
}

.menu-btn {
  background: none;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
}

.menu-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-left {
  width: 40px;
}

/* ==========================================================
   Hero Section
   ========================================================== */
.payment-hero {
  width: 100%;
  position: relative;
  height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-bg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.18);
}

.hero-content-wrapper {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 55px;
  padding-bottom: 18px;
}

/* Green Title Banner with rounded left corner */
.hero-title-badge {
  background: var(--banner-green);
  display: inline-block;
  align-self: flex-start; /* Aligns to right in RTL */
  padding: 14px 34px 14px 44px;
  border-radius: 40px 0 0 40px; /* Rounded towards center/left */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Bottom area inside hero */
.hero-bottom-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.hero-divider-line {
  width: 88%;
  max-width: 420px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.45);
  margin-bottom: 14px;
}

.hero-social-shares {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.share-btn {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), filter var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.share-fb {
  background-color: #4A6EA9;
}

.share-x {
  background-color: #000000;
}

.share-mail {
  background-color: #616161;
}

.share-wa {
  background-color: #25D366;
}

/* ==========================================================
   Bill Payment Form Section
   ========================================================== */
.payment-form-section {
  width: 100%;
  background-color: var(--bg-white);
  padding: 45px 16px 50px;
  display: flex;
  justify-content: center;
}

.form-wrapper {
  width: 100%;
  max-width: 440px; /* Match mobile screenshot */
  display: flex;
  flex-direction: column;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}

.form-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
  text-align: right;
}

.required-star {
  color: #E53935;
  font-weight: 800;
  margin-right: 2px;
}

/* Custom Select */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.form-select {
  width: 100%;
  height: 56px;
  background-color: var(--bg-select);
  border: 1px solid var(--border-select);
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
  padding: 0 16px 0 45px;
  direction: rtl;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color var(--transition);
}

.form-select:focus {
  border-color: var(--primary-green);
}

.select-arrow-box {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subscription Input */
.input-wrapper {
  width: 100%;
}

.form-input {
  width: 100%;
  height: 52px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-dark);
  padding: 0 16px;
  direction: ltr;
  text-align: right;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
  color: #CCCCCC;
  font-weight: 500;
}

.form-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(66, 171, 62, 0.12);
}

.form-input.has-error {
  border-color: #E53935;
  background-color: #FFF8F8;
}

.error-msg {
  display: none;
  color: #E53935;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 6px;
  text-align: right;
}

.error-msg.visible {
  display: block;
}

/* Submit Action Button */
.form-action-group {
  margin-top: 8px;
}

.btn-submit {
  width: 100%;
  height: 54px;
  background-color: var(--primary-green);
  color: #FFFFFF;
  font-size: 21px;
  font-weight: 800;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 3px 8px rgba(66, 171, 62, 0.25);
}

.btn-submit:hover {
  background-color: var(--primary-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(66, 171, 62, 0.32);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ==========================================================
   Loading Overlay & Spinner
   ========================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spinner {
  width: 55px;
  height: 55px;
  border: 5px solid #e5e5e5;
  border-top-color: #4cae3f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Gateway Transfer Overlay */
.payment-loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeInOverlay 0.3s ease;
}

.payment-spinner {
  width: 55px;
  height: 55px;
  border: 5px solid #e5e7eb;
  border-top-color: #12326b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.payment-loading-text {
  margin-top: 20px;
  font-size: 18px;
  color: #1a202c;
  font-weight: 700;
  text-align: center;
}

.payment-loading-subtext {
  margin-top: 6px;
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================
   Step 2: Unblock Meter Fees Result Area
   ========================================================== */
.bill-result-card {
  display: none;
  flex-direction: column;
  margin-top: 25px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.bill-result-card.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.fees-notice-link {
  font-size: 14px;
  font-weight: 800;
  color: #1A202C;
  text-align: center;
  margin-bottom: 22px;
  text-decoration: underline;
  text-underline-offset: 3px;
  line-height: 1.6;
  display: block;
}

.fees-notice-link:hover {
  color: var(--primary-green);
}

/* Fees Table Box */
.fees-table-container {
  width: 100%;
  background: #FFFFFF;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid #ECECEC;
}

.fees-table-header {
  background-color: #333A42;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  padding: 13px 18px;
}

.th-cell {
  font-size: 15px;
  font-weight: 800;
}

.fees-table-body {
  background-color: #FFFFFF;
}

.fees-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #EEEEEE;
}

.td-cell {
  font-size: 15px;
  font-weight: 700;
  color: #222222;
}

.fee-amount {
  font-size: 16px;
  font-weight: 800;
  color: #111111;
}

.fees-notes-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background-color: #FAFAFA;
}

.notes-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #555555;
}

.notes-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #222222;
}

.pay-button {
  width: 100%;
  height: 58px;
  background: #42AB3E;
  color: #FFFFFF;
  border: none;
  border-radius: 5px;
  font-size: 23px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), transform var(--transition);
  box-shadow: 0 3px 8px rgba(66, 171, 62, 0.25);
}

.pay-button:hover {
  background-color: #369432;
  transform: translateY(-1px);
}

.pay-button:active {
  transform: translateY(0);
}

/* ==========================================================
   Site Footer
   ========================================================== */
.site-footer {
  width: 100%;
  background-color: var(--bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 35px;
}

.footer-links-container {
  width: 100%;
  max-width: 440px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links-row a {
  font-size: 13.5px;
  font-weight: 700;
  color: #111111;
  transition: color var(--transition);
}

.footer-links-row a:hover {
  color: var(--primary-green);
}

.sep {
  color: #777777;
  font-size: 14px;
  font-weight: bold;
}

/* Footer Bottom Area */
.footer-bottom-section {
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, rgba(218, 244, 252, 0.45) 0%, rgba(255, 255, 255, 0) 40%);
  padding: 30px 16px 35px;
  display: flex;
  justify-content: center;
}

.footer-contact-area {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.social-subheading {
  font-size: 13px;
  font-weight: 600;
  color: #444444;
  margin-bottom: 16px;
}

.social-boxes-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 25px;
}

.social-box {
  width: 38px;
  height: 38px;
  background-color: #8D8D8D;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), transform var(--transition);
}

.social-box:hover {
  background-color: var(--primary-green);
  transform: translateY(-2px);
}

/* Divider with Scroll-To-Top Green Button */
.footer-divider-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.footer-line {
  width: 100%;
  height: 1px;
  background-color: #DEDEDE;
}

.scroll-top-btn {
  position: absolute;
  left: 0; /* Positioned on the left in RTL like screenshot */
  width: 34px;
  height: 34px;
  background-color: #4E9F16;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), transform var(--transition);
  box-shadow: 0 2px 6px rgba(78, 159, 22, 0.25);
}

.scroll-top-btn:hover {
  background-color: #3D8510;
  transform: scale(1.05);
}

/* Copyright Typography */
.copyright-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copyright-txt {
  font-size: 12.5px;
  font-weight: 700;
  color: #333333;
}

.developer-txt {
  font-size: 12px;
  font-weight: 600;
  color: #333333;
}

/* ==========================================================
   Modals
   ========================================================== */
.payment-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.payment-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.payment-modal-box {
  background: #FFFFFF;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  padding: 24px;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.payment-modal-backdrop.open .payment-modal-box {
  transform: scale(1);
}

.payment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EEEEEE;
}

.modal-h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  font-size: 26px;
  color: #777;
  line-height: 1;
}

.payment-summary {
  background-color: #F8FAFC;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 8px;
  color: #444;
}

.summary-row:last-child {
  margin-bottom: 0;
}

.total-highlight {
  border-top: 1px dashed #D0D7DE;
  padding-top: 8px;
  margin-top: 8px;
  font-size: 15px;
  color: var(--accent-blue-dark);
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.method-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.method-option:hover, .method-option.active {
  border-color: var(--primary-green);
  background-color: #F6FCF5;
}

.method-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

.btn-confirm-payment {
  width: 100%;
  height: 48px;
  background-color: var(--primary-green);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 800;
  border-radius: 8px;
  transition: background-color var(--transition);
}

.btn-confirm-payment:hover {
  background-color: var(--primary-green-dark);
}

.text-center {
  text-align: center;
}

.success-icon-box {
  width: 70px;
  height: 70px;
  background-color: #EAF8E8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success-title {
  font-size: 20px;
  font-weight: 800;
  color: #222;
  margin-bottom: 8px;
}

.success-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 22px;
}

/* ==========================================================
   Responsive Adaptations (Tablet & Desktop)
   ========================================================== */
@media (min-width: 768px) {
  .top-utility-bar {
    height: 42px;
  }

  .utility-container, .header-container {
    max-width: 1100px;
  }

  .payment-hero {
    height: 380px;
  }

  .hero-title-badge {
    padding: 16px 50px 16px 60px;
  }

  .hero-title {
    font-size: 32px;
  }

  .form-wrapper {
    max-width: 650px;
  }

  .footer-links-container, .footer-contact-area {
    max-width: 650px;
  }
}
