
@font-face {
  font-family: 'El Messiri';
  src: url('../fonts/ElMessiri-Medium.woff2') format('woff2'),
       url('../fonts/ElMessiri-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary-color: #e11d48;       /* وردي غني وراقي */
  --primary-hover: #be123c;       /* درجة وردي أغمق للـ Hover */
  --primary-light: #fff1f2;      /* خلفية وردية هادئة جداً */
  --bg-gradient: #fff5f7;
  --card-bg: #ffffff;
  --text-dark: #111827;
  --text-muted: #4b5563;
  --border-color: #fecdd3;
  --radius-lg: 24px;
  --radius-md: 12px;
  --shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

body {
  background: var(--bg-gradient);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .60) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .60) 50%, rgba(255, 255, 255, .60) 75%, transparent 75%, transparent);
  background-size: 200px 200px;
  font-family: 'El Messiri', sans-serif;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.page-wrapper {
  max-width: 100%;
  margin: 30px auto;
  padding: 0 16px;
}

/* Header Section */
.whats {
  text-align: center;
  margin-bottom: 24px;
}

.badge-top {
  display: inline-block;
  padding: 6px 16px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #9f1239;
  background-color: #ffe4e6;
  border-radius: 9999px;
}

.whats h1 {
  font-size: 28px;
  font-weight: bold;
  color: #111827;
  margin: 0 0 10px 0;
}

#form1 {
  display: none;
}

.title-line {
  width: 96px;
  height: 4px;
  background-color: var(--primary-color);
  margin: 0 auto;
  border-radius: 9999px;
}

/* Main Calculator Card */
.main {
  background: var(--card-bg);
  border: 1px solid #ffe4e6;
  border-radius: var(--radius-lg);
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto 24px auto;
  text-align: center;
  box-shadow: var(--shadow);
  padding: 30px 24px;
}

.main3 h2 {
  font-size: 16px;
  color: var(--text-muted);
  background-color: #fff1f2;
  padding: 16px;
  margin: -30px -24px 24px -24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid #ffe4e6;
  font-weight: 600;
}

/* Form Inputs Grid */
.qar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  margin: 0 auto 24px auto;
  text-align: right;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group.full-width {
  grid-column: span 2;
}

.leb {
  font-size: 15px;
  font-weight: bold;
  color: #374151;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input, select {
  font-family: 'El Messiri', sans-serif;
  width: 100%;
  height: 48px;
  font-size: 16px;
  text-align: right;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fffafb;
  outline: none;
  transition: all 0.2s;
}

input:focus, select:focus {
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

select {
  appearance: none;
  cursor: pointer;
  padding-right: 38px;
}

.select-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
}

.input-suffix {
  position: absolute;
  left: 10px;
  background-color: #ffe4e6;
  color: #9f1239;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
}

.input-suffix-symbol {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  font-weight: bold;
}

/* Helper Badge Months Banner */
#years {
  background-color: #fff1f2;
  border: 1px dashed #fecdd3;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 4px;
  text-align: center;
  font-size: 14px;
  color: #be123c;
  font-weight: 600;
}

/* Buttons */
.buttons-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.t1 {
  font-family: 'El Messiri', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  background-color: var(--primary-color);
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: bold;
  padding: 12px 32px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.25);
  transition: all 0.2s;
}

.t1:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.t1:last-child {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
  box-shadow: none;
}

.t1:last-child:hover {
  background-color: #e5e7eb;
}

/* Results Section */
#form1 {
  background-color: #fffafb;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #ffe4e6;
}

.results-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.results-grid-container:last-child {
  margin-bottom: 0;
}

.new {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  border: 1px solid #fecdd3;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
}

.result-value-box {
  font-size: 20px;
  font-weight: 800;
}

/* Share Button */
button.t3 {
  font-family: 'El Messiri', sans-serif;
  border-radius: var(--radius-md);
  background-color: var(--primary-color);
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: bold;
  padding: 12px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.25);
  margin-bottom: 10px;
}

button.t3:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Content Article Section */
.content2 {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid #ffe4e6;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  text-align: right;
}

.content2 h3 {
  font-size: 22px;
  color: #881337;
  margin-top: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #ffe4e6;
  padding-bottom: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.content2 p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 16px 0;
}

.img-box {
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.content2 img {
  width: 100%;
  max-width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}

.img-caption {
  font-size: 12px;
  font-weight: 600;
  color: #9f1239;
}

/* Related Links Section */
.dc-related {
  background: var(--card-bg);
  border: 1px solid #ffe4e6;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: right;
}

.dc-related h4 {
  font-size: 18px;
  color: #111827;
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-related-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.dc-btn {
  text-decoration: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid #fecdd3;
  background-color: #fff1f2;
  color: #9f1239;
}

.dc-btn:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .qar-grid, .content-grid, .dc-related-links, .results-grid-container {
    grid-template-columns: 1fr;
  }
  .input-group.full-width {
    grid-column: span 1;
  }
  .buttons-wrapper {
    flex-direction: column;
  }
  .t1 {
    width: 100%;
  }
}