/* Reset and base */
* { box-sizing: border-box; }
html,body { height:100%; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(#f4f4f4, #e8e8e8);
  color: #222;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center; /* everything centered horizontally */
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(32px, 8vw, 80px) clamp(12px, 4vw, 20px); /* fluid spacing above and below */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Top logo area */
.top {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: clamp(24px, 5vw, 40px);
  max-width: 100%;
  text-align: center;
}
.logo {
  width: min(180px, 42vw);
  height: auto;
  display: block;
  flex-shrink: 0;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}
.brand-title {
  color: #003c7a;
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 1px;
  overflow-wrap: break-word;
}
.brand-line {
  width: 80px;
  height: 5px;
  background: linear-gradient(90deg, #ffd400, #ffed4e);
  margin-top: 8px;
  border-radius: 2px;
}
.brand-sub {
  color: #666;
  font-size: 13px;
  margin-top: 8px;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* Main area */
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.05));
  border: 1px solid #27ae60;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 25px;
  font-size: 13px;
  font-weight: 600;
  color: #27ae60;
  max-width: 100%;
  text-align: center;
}

.lock-icon {
  width: 18px;
  height: 18px;
  color: #27ae60;
}

.badge-text {
  letter-spacing: 0.3px;
}

.login-box {
  width: min(430px, 100%);
  max-width: 100%;
  background: #ffffff;
  border: none;
  border-radius: 12px;
  padding: clamp(24px, 6vw, 45px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.field-label {
  display: block;
  color: #003c7a;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.label-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.input-wrap {
  margin-bottom: 22px;
  position: relative;
}

.input {
  width: 100%;
  min-height: 48px; /* touch-friendly target */
  border-radius: 8px;
  border: 1px solid #d0d0d0;
  padding: 12px 16px;
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  font-weight: 500;
  transition: all 0.3s ease;
  background: #fafafa;
  max-width: 100%;
}

.input:focus {
  outline: none;
  border-color: #003c7a;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 60, 122, 0.08);
}

.input::placeholder {
  color: #999;
  font-weight: 400;
}

.input-status {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.3s ease;
}

.input:focus ~ .input-status {
  background: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

.password-strength {
  margin-bottom: 25px;
}

.strength-bar {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: #ccc;
  transition: all 0.4s ease;
  border-radius: 2px;
}

.strength-text {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

.enter-btn {
  background: #003c7a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 13px 24px;
  min-height: 48px; /* touch-friendly target */
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 60, 122, 0.25);
  margin-top: 8px;
}

.btn-icon {
  font-size: 16px;
}

.enter-btn:hover {
  background: #002849;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 60, 122, 0.35);
}

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

.trust-indicators {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.indicator svg {
  width: 28px;
  height: 28px;
  color: #27ae60;
}

.call-center {
  margin-top: 18px;
  text-align: center;
  color: #666;
  font-size: 13px;
}
.call-center .phone {
  margin-bottom: 4px;
  font-weight: 600;
}

/* Responsive: small phones */
@media (max-width: 480px) {
  .page {
    padding: 32px 12px;
  }

  .top {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .brand { align-items: center; }
  .brand-title { font-size: 24px; }
  .brand-sub { font-size: 12px; }
  .login-box { padding: 24px 18px; border-radius: 10px; }
  .logo { width: min(140px, 50vw); }
  .form-heading { font-size: 18px !important; }
  .security-badge { font-size: 12px; padding: 8px 12px; }
  .call-center { font-size: 12px; }
}

/* Responsive: large phones / small tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .page { padding: 48px 20px; }
  .top { gap: 16px 20px; margin-bottom: 32px; }
  .brand-title { font-size: 30px; }
  .login-box { padding: 36px 30px; }
  .logo { width: 160px; }
}

/* Responsive: tablets / small laptops */
@media (min-width: 769px) and (max-width: 1024px) {
  .login-box { width: min(480px, 100%); }
}

/* Responsive: large desktops */
@media (min-width: 1200px) {
  .page { max-width: 900px; margin: 0 auto; }
}

/* Responsive: short landscape screens */
@media (max-height: 500px) and (orientation: landscape) {
  .page { padding: 20px 16px; }
  .top { margin-bottom: 16px; }
  .logo { width: 110px; }
  .brand-title { font-size: 22px; }
  .login-box { padding: 24px; }
  .security-badge { margin-bottom: 14px; }
}

/* Right-to-left support for Arabic */
html[dir="rtl"] .field-label {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .input {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .brand {
  align-items: flex-end;
}

html[dir="rtl"] .field-hint {
  text-align: right;
}

html[dir="rtl"] .form-heading {
  text-align: right;
}
