/* =========================================
   Aseer Municipality SSO - Main Styles
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
  --primary: #3aada8;
  --primary-hover: #2d9490;
  --primary-light: #e8f6f5;
  --error: #dc3545;
  --text-dark: #1a1a2e;
  --text-muted: #6c757d;
  --border: #d0d5dd;
  --border-focus: #3aada8;
  --white: #ffffff;
  --bg-card: rgb(255, 255, 255);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --input-radius: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
}

body {
  font-family: 'Tajawal', sans-serif;
  min-height: 100vh;
  background: #1a4a3a;
  position: relative;
  overflow-x: hidden;
}

/* ── Background ── */
.bg-scene {
    position: fixed;
    inset: 0;
    background-image: url('../assests/BG_imageV2.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
    filter: brightness(0.82);
}
    /* overlay */
    .bg-scene::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4); /* 40% black */
        z-index: 1;
    }

/* ── Top Navigation ── */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 6px 14px;
  transition: background 0.2s;
}
.lang-toggle:hover {
  background: rgba(255,255,255,0.25);
  color: var(--white);
  text-decoration: none;
}
.lang-toggle svg {
  width: 18px;
  height: 18px;
}

.home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}
.home-link:hover {
  opacity: 0.85;
  color: var(--white);
  text-decoration: none;
}

/* ── Page Layout ── */
.page-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 16px 60px;
}

/* ── Card ── */
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 44px 40px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow);
  animation: cardIn 0.4s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo / Brand Bar ── */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: right;
  gap: 18px;
  margin-bottom: 28px;
}
.brand-bar img {
  height: 52px;
}
.brand-connector {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #bbb;
}
.brand-connector .line {
  width: 48px;
  height: 4px;
  background: #ccc;
  border-radius: 9999px;
}
.gradient-Line {
    background: linear-gradient(-90deg, #604C45 0%, #007B69 100%) !important;
}
.aToBn {
    width: 100%;
    text-decoration: none;
    display: block;
    text-align: center;
}
.brand-connector .shield-icon {
    color: var(--primary);
    font-size: 20px;
}
.fm-margin{
  margin: 0px 40px;
}
/* Nafath logo text */
.nafath-logo {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
}

/* ── Card Header ── */
.card-title {
  font-family: IBM Plex Sans;
  font-weight: 400;
  font-style: Regular;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0%;
  text-align: right;
  vertical-align: middle;
}
.card-subtitle {
font-family: IBM Plex Sans;
font-weight: 400;
font-style: Regular;
font-size: 13.8px;
line-height: 22.5px;
letter-spacing: 0%;
text-align: right;
vertical-align: middle;
opacity: 0.7;
color: rgba(47, 43, 61, 1);
padding-bottom: 36px;

}
.form-control{
  border: 1px solid rgba(0, 123, 105, 1);box-shadow: 0px 0px 0px 1px rgba(0, 123, 105, 1);
}
/* ── Form Elements ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
  text-align: right;
}
.form-label .required {
  color: var(--error);
  margin-right: 2px;
}

.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--input-radius);
  padding: 12px 16px;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
  text-align: right;
}
.form-control::placeholder {
  color: #aaa;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(58, 173, 168, 0.12);
}
.form-control.is-invalid {
  border-color: var(--error);
}
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

/* Password input wrapper */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-control {
  padding-left: 44px;
  letter-spacing: 3px;
}
.password-toggle {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #aaa;
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.password-toggle:hover { color: var(--primary); }

/* ── Buttons ── */
.btn-primary-solid {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--input-radius);
  padding: 13px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}
.btn-primary-solid:hover {
  background: var(--primary-hover);
}
.btn-primary-solid:active {
  transform: scale(0.99);
}
.btn-primary-solid:disabled {
  background: #b0d8d6;
  cursor: not-allowed;
}

.btn-outline {
  width: 100%;
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--input-radius);
  padding: 12px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 10px;
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 22px 0;
}

/* ── Username/Password Alt Login ── */
.alt-login-btn {
  width: 100%;
  background: #f5f5f5;
  color: var(--text-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--input-radius);
  padding: 12px 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.alt-login-btn:hover { background: #ebebeb; }

/* ── Forgot Password Link ── */
.forgot-row {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
}
.forgot-row a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.forgot-row a:hover { text-decoration: underline; }

/* ── User Badge (2FA screen) ── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.user-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}
.user-badge .username { font-weight: 600; color: var(--text-dark); }
.user-badge .org { color: var(--text-muted); }

/* ── 2FA OTP Input ── */
.otp-input {
  text-align: center;
  letter-spacing: 6px;
  font-size: 20px;
  font-weight: 700;
}

/* ── Timer ── */
.timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--error);
  font-size: 18px;
  font-weight: 700;
  margin-top: 20px;
}
.timer-row svg { font-size: 20px; }

/* ── Password Rules ── */
.password-rules {
  list-style: disc;
  padding-right: 20px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: right;
}


/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 44px 40px;
  width: 100%;
  max-width: 500px;
  text-align: center;
  position: relative;
  animation: cardIn 0.3s ease;
}
.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { color: var(--text-dark); }

/* ── Success Icon ── */
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: var(--primary);
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.success-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

.btn-continue {
  background: #e8e8e8;
  color: var(--text-muted);
  border: none;
  border-radius: var(--input-radius);
  padding: 11px 40px;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-continue:hover { background: #ddd; color: var(--text-dark); }

/* ── Footer ── */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 14px;
  color: var(--white);
  font-size: 13px;
  z-index: 10;
  background: linear-gradient(transparent, rgba(0,0,0,0.25));
}
.page-footer strong { font-weight: 700; }

.Img-Nafath{
  height: 45px;
}

/* ── Responsive ── */
@media (max-width: 576px) {
  .auth-card {
    padding: 30px 22px;
    border-radius: 10px;
  }
  .brand-connector .line {
  width: 30px;
  height: 4px;
  background: #ccc;
  border-radius: 9999px;
}
  .Img-Nafath{height: 20px !important;}
  .card-subtitle{font-size: 10px;}
  .forgot-row{font-size: 10px;}
  .Img-Asser{height: 20px !important;}
  .top-nav { padding: 14px 18px; }
  .card-title { font-size: 19px; }
  .nafath-logo { font-size: 26px; }
  .brand-bar img { height: 42px; }
  .modal-card { padding: 32px 22px; }
  .toast-error { left: 16px; bottom: 16px; }
}

/* ── Hidden utility ── */
.hidden { display: none !important; }
