@font-face {
  font-family: "ABCArizonaSerif-Regular";
  src: url('../fonts/ABCArizonaSerif-Regular.otf');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "HTMoshreqPro-Regular";
  src: url('../fonts/HTMoshreqPro-Regular.otf');
  font-weight: normal;
  font-style: normal;
}

html {
  background: transparent !important;
  background-color: transparent !important;
  overflow-x: hidden;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: 'ABCArizonaSerif-Regular', serif;
  margin: 0;
  padding: 0;
  color: #F4E4CF;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: transparent !important;
  background-color: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Arabic font for RTL content */
html[dir="rtl"] body,
html[lang="ar"] body {
  font-family: 'HTMoshreqPro-Regular', serif;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/refad.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(25px) brightness(0.3);
  transform: scale(1.1);
  z-index: -2;
  will-change: transform;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(43, 72, 110, 0.4);
  z-index: -1;
}

.container {
  position: relative;
  z-index: 1;
  background: transparent !important;
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

/* Prevent canvas from overflowing on small screens */
.canvas-wrapper {
  max-width: 100%;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 992px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  canvas {
    max-height: 55vh;
  }
}

/* Mobile landscape and below */
@media (max-width: 768px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    min-height: auto;
  }
  
  canvas {
    max-height: 50vh;
  }
  
  .step-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }
  
  .step-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  
  .nav-btn {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    min-height: 50px;
  }
  
  .form-control {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .form-label {
    font-size: 0.9rem;
  }
  
  .input-feedback {
    font-size: 0.8rem;
  }
  
  .char-counter {
    font-size: 0.75rem;
  }
}

/* Mobile portrait */
@media (max-width: 576px) {
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    min-height: auto;
  }
  
  canvas {
    max-height: 45vh;
    border-radius: 8px;
  }
  
  .step-title {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
  }
  
  .step-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
  }
  
  .nav-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    min-height: 48px;
  }
  
  .form-control {
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
  }
  
  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
  }
  
  .input-feedback {
    font-size: 0.75rem;
    min-height: 1rem;
  }
  
  .char-counter {
    font-size: 0.7rem;
  }
  
  .name-input-wrap .mb-3 {
    margin-bottom: 1.25rem !important;
  }
  
  footer {
    padding: 0.75rem 0.5rem;
  }
  
  .powered-by {
    font-size: 0.8rem;
  }
  
  footer a img {
    height: 24px;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  .container {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    min-height: auto;
  }
  
  canvas {
    max-height: 40vh;
  }
  
  .step-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .step-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .nav-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
  }
  
  .form-control {
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .form-label {
    font-size: 0.8rem;
  }
  
  .input-feedback {
    font-size: 0.7rem;
  }
  
  .char-counter {
    font-size: 0.65rem;
  }
  
  footer {
    padding: 0.5rem 0.375rem;
  }
  
  .powered-by {
    font-size: 0.75rem;
  }
  
  footer a img {
    height: 20px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  canvas {
    max-height: 60vh;
  }
  
  .step-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .step-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .nav-btn {
    padding: 0.75rem 1.25rem;
    min-height: 44px;
  }
}

.form-control,
.btn {
  border-radius: 12px;
}

.form-control {
  background-color: #28303C !important;
  color: #ffffff !important;
  border: none !important;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: none;
  font-family: inherit;
}

.form-control::placeholder {
  color: rgba(244, 228, 207, 0.6);
  font-size: 0.95rem;
  opacity: 1;
}

.form-control:focus {
  background-color: #2C3E50 !important;
  border: none !important;
  box-shadow: 0 0 0 2px rgba(244, 228, 207, 0.3);
  outline: none;
}

.form-control:focus-visible {
  box-shadow: 0 0 0 2px rgba(244, 228, 207, 0.5);
}

/* Step 3: name inputs same width as CTA buttons */
.step3-content .name-input-wrap,
.step3-content .name-input-wrap input#nameEnglish,
.step3-content .name-input-wrap input#nameArabic {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* English name input - left aligned */
.step3-content input#nameEnglish {
  text-align: left !important;
  direction: ltr !important;
}

/* Arabic name input - right aligned */
.step3-content input#nameArabic {
  text-align: right !important;
  direction: rtl !important;
}

.input-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-height: 1.5rem;
}

.input-feedback {
  flex: 1;
  text-align: center;
  color: #ff6b6b;
  font-size: 0.85rem;
  min-height: 1.2rem;
}

.input-feedback.success {
  color: #51cf66;
}

.char-counter {
  font-size: 0.8rem;
  color: rgba(244, 228, 207, 0.7);
  flex-shrink: 0;
}

[dir="rtl"] .input-meta {
  flex-direction: row-reverse;
}

/* Form labels for Refad dual name inputs */
.form-label {
  color: #F4E4CF;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.name-input-wrap .mb-3 {
  margin-bottom: 1.5rem !important;
}

.btn-light {
  background-color: #F4E4CF !important;
  color: #000000 !important;
  border: none !important;
  font-weight: 600;
  font-family: inherit;
}

.btn-light:hover {
  background-color: #e8d4b8 !important;
}


.alert {
  background-color: #1e1e1e;
  border-color: #333;
}

.alert-heading {
  font-size: 1.5rem;
}

.info-text {
  color: #aaa;
  font-size: 1rem;
}

/* Center all step text */
.step-title,
.step-subtitle,
.step p,
.step h2,
.input-feedback,
.step-label {
  text-align: center;
  color: #F4E4CF;
  font-family: inherit;
}

.step .row {
  justify-content: center;
}

footer {
  background-color: transparent;
  padding: 0.5rem 1.25rem;
  position: relative;
  z-index: 1;
  margin-top: 0;
  border-top: 1px solid rgba(244, 228, 207, 0.2);
}

@media (max-width: 768px) {
  footer {
    margin-top: 0;
    padding: 0.4rem 1rem;
    border-top: 1px solid rgba(244, 228, 207, 0.15);
  }
}

@media (max-width: 576px) {
  footer {
    margin-top: 0;
    padding: 0.4rem 0.75rem;
    border-top: 1px solid rgba(244, 228, 207, 0.1);
  }
}

@media (max-width: 380px) {
  footer {
    margin-top: 0;
    padding: 0.3rem 0.5rem;
    border-top: none;
  }
}

footer p {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

footer a {
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  transition: opacity 0.3s ease;
  text-decoration: none;
}

footer a:hover {
  opacity: 1;
}

footer a:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

footer a img {
  display: block;
  transition: transform 0.3s ease;
  filter: brightness(0) invert(1) opacity(0.7);
}

footer a:hover img {
  transform: scale(1.05);
  filter: brightness(0) invert(1) opacity(1);
}

.powered-by {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.5px;
}

@media (max-width: 576px) {
  footer p {
    gap: 0.375rem;
  }
  
  .powered-by {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
  }
  
  footer a {
    color: rgba(255, 255, 255, 0.7);
  }
  
  footer a img {
    height: 22px;
    filter: brightness(0) invert(1) opacity(0.7);
  }
  
  footer a:hover img {
    filter: brightness(0) invert(1) opacity(1);
  }
}

@media (max-width: 380px) {
  footer p {
    gap: 0.25rem;
  }
  
  .powered-by {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
  }
  
  footer a {
    color: rgba(255, 255, 255, 0.7);
  }
  
  footer a img {
    height: 20px;
    filter: brightness(0) invert(1) opacity(0.7);
  }
  
  footer a:hover img {
    filter: brightness(0) invert(1) opacity(1);
  }
}

.footer-logo {
  height: 28px;
  margin-left: 0.5rem;
}
