/* ETG Auth Pages — Professional Login & Register UI v1.0 */

/* ====== PAGE WRAPPER ====== */
.etg-auth-page {
  --etg-primary: #1a5eff;
  --etg-primary-dark: #0f3dd6;
  --etg-primary-soft: #eef3ff;
  --etg-green: #00875a;
  --etg-red: #de350b;
  --etg-text: #172b4d;
  --etg-muted: #7a869a;
  --etg-border: #dfe1e6;
  --etg-bg: #f4f5f7;
  --etg-shadow: 0 8px 32px rgba(9,30,66,.18), 0 2px 8px rgba(9,30,66,.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f3dd6 0%, #1a5eff 50%, #2978ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.etg-auth-page::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(255,255,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(0,0,0,.12) 0%, transparent 60%);
  pointer-events: none;
}

.etg-auth-page * { box-sizing: border-box; }

/* ====== AUTH CARD ====== */
.etg-auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--etg-shadow);
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ====== BRAND HEADER ====== */
.etg-auth-brand {
  background: linear-gradient(135deg, #0f3dd6 0%, #1a5eff 100%);
  padding: 32px 36px 28px;
  text-align: center;
  color: #fff;
  position: relative;
}
.etg-auth-brand::after {
  content: "";
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 32px;
  background: #fff;
  border-radius: 32px 32px 0 0;
}
.etg-auth-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: rgba(255,255,255,.18);
  border-radius: 18px;
  margin-bottom: 14px;
  font-size: 32px;
  backdrop-filter: blur(8px);
}
.etg-auth-brand h1 {
  margin: 0 0 6px;
  font-size: 26px; font-weight: 800; line-height: 1.2;
  color: #fff;
}
.etg-auth-brand p {
  margin: 0; font-size: 14px;
  color: rgba(255,255,255,.8); line-height: 1.4;
}

/* ====== BODY ====== */
.etg-auth-body {
  padding: 8px 36px 36px;
}

/* ====== TABS ====== */
.etg-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #f4f5f7;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}
.etg-auth-tab {
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--etg-muted);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
  position: relative;
}
.etg-auth-tab.is-active {
  background: #fff;
  color: var(--etg-text);
  box-shadow: 0 2px 8px rgba(9,30,66,.14);
}

/* ====== FORM FIELDS ====== */
.etg-auth-form { display: flex; flex-direction: column; gap: 0; }
.etg-auth-form[hidden] { display: none; }

.etg-form-group {
  margin-bottom: 18px;
  position: relative;
}
.etg-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--etg-text);
  line-height: 1;
}
.etg-form-input-wrap { position: relative; }
.etg-form-input {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--etg-border);
  border-radius: 12px;
  padding: 0 44px 0 16px;
  font-size: 15px;
  color: var(--etg-text);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.etg-form-input:focus {
  border-color: var(--etg-primary);
  box-shadow: 0 0 0 3px rgba(26,94,255,.14);
}
.etg-form-input::placeholder { color: #b0b8c8; }
.etg-form-input.is-error {
  border-color: var(--etg-red);
  box-shadow: 0 0 0 3px rgba(222,53,11,.1);
}

.etg-form-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--etg-muted); font-size: 18px; pointer-events: none;
  line-height: 1;
}

/* Password toggle */
.etg-toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; padding: 0;
  color: var(--etg-muted); font-size: 20px; cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.etg-toggle-pw:hover { color: var(--etg-text); }

/* Password strength bar */
.etg-pw-strength {
  height: 4px; border-radius: 4px; margin-top: 6px;
  background: #e8eaed; overflow: hidden;
}
.etg-pw-strength-bar {
  height: 100%; border-radius: 4px; width: 0;
  transition: width .3s ease, background .3s;
}
.etg-pw-strength-bar.weak { width: 25%; background: var(--etg-red); }
.etg-pw-strength-bar.fair { width: 50%; background: #ff9800; }
.etg-pw-strength-bar.good { width: 75%; background: #f0ad00; }
.etg-pw-strength-bar.strong { width: 100%; background: var(--etg-green); }

.etg-pw-strength-label {
  font-size: 11.5px; margin-top: 4px;
  color: var(--etg-muted); font-weight: 600;
}
.etg-pw-strength-label.weak { color: var(--etg-red); }
.etg-pw-strength-label.fair { color: #e65c00; }
.etg-pw-strength-label.good { color: #c87800; }
.etg-pw-strength-label.strong { color: var(--etg-green); }

/* Field error message */
.etg-form-error {
  font-size: 12px; color: var(--etg-red);
  font-weight: 600; margin-top: 5px;
  display: none;
}
.etg-form-error.is-visible { display: block; }

/* ====== REMEMBER + FORGOT ====== */
.etg-form-footer {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 22px;
}
.etg-remember-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--etg-text); cursor: pointer;
}
.etg-remember-label input {
  width: 16px; height: 16px;
  accent-color: var(--etg-primary); cursor: pointer; margin: 0;
}
.etg-forgot-link {
  font-size: 13.5px; font-weight: 700;
  color: var(--etg-primary);
  text-decoration: none;
  transition: color .15s;
}
.etg-forgot-link:hover { color: var(--etg-primary-dark); text-decoration: underline; }

/* ====== TERMS CHECKBOX ====== */
.etg-terms-label {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--etg-muted); line-height: 1.4;
  cursor: pointer; margin-bottom: 22px;
}
.etg-terms-label input {
  width: 16px; height: 16px; flex: 0 0 16px;
  accent-color: var(--etg-primary); cursor: pointer; margin-top: 1px;
}
.etg-terms-label a { color: var(--etg-primary); font-weight: 700; }

/* ====== SUBMIT BUTTON ====== */
.etg-auth-submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--etg-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(26,94,255,.3);
  transition: background .18s, box-shadow .18s, transform .1s;
  position: relative;
  overflow: hidden;
  letter-spacing: .2px;
}
.etg-auth-submit:hover {
  background: var(--etg-primary-dark);
  box-shadow: 0 6px 24px rgba(26,94,255,.4);
  transform: translateY(-1px);
}
.etg-auth-submit:active { transform: translateY(0); }
.etg-auth-submit:disabled {
  opacity: .6; cursor: not-allowed; transform: none;
}

/* Loading state */
.etg-auth-submit.is-loading::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,.15);
  animation: etg-shimmer 1.5s infinite;
}
@keyframes etg-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ====== DIVIDER ====== */
.etg-auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
}
.etg-auth-divider::before,
.etg-auth-divider::after {
  content: ""; flex: 1;
  height: 1px; background: var(--etg-border);
}
.etg-auth-divider span { font-size: 12.5px; color: var(--etg-muted); font-weight: 600; }

/* ====== SOCIAL LOGIN BUTTONS ====== */
.etg-social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0; }
.etg-social-btn {
  height: 48px;
  border: 1.5px solid var(--etg-border);
  border-radius: 12px;
  background: #fff;
  color: var(--etg-text);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: background .15s, border-color .15s;
}
.etg-social-btn:hover { background: #f7f8fa; border-color: #c5cad2; }

/* ====== GLOBAL SUCCESS MESSAGE ====== */
.etg-auth-message {
  border-radius: 10px; padding: 12px 16px;
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
  margin-bottom: 20px; display: none;
}
.etg-auth-message.is-visible { display: block; }
.etg-auth-message.is-success {
  background: var(--etg-green-soft, #e3fcef);
  color: var(--etg-green);
  border: 1px solid rgba(0,135,90,.2);
}
.etg-auth-message.is-error {
  background: #fff0ed;
  color: var(--etg-red);
  border: 1px solid rgba(222,53,11,.2);
}

/* ====== FOOTER LINK ====== */
.etg-auth-card-footer {
  text-align: center;
  padding: 0 36px 28px;
  font-size: 13.5px; color: var(--etg-muted);
}
.etg-auth-card-footer a {
  color: var(--etg-primary); font-weight: 700;
  text-decoration: none;
}
.etg-auth-card-footer a:hover { text-decoration: underline; }

/* ====== AUTH MODAL (overlay when booking) ====== */
.etg-auth-modal-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(9,30,66,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.etg-auth-modal-backdrop.is-open {
  opacity: 1; pointer-events: all;
}
.etg-auth-modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--etg-shadow);
  width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px) scale(.98);
  transition: transform .3s ease;
}
.etg-auth-modal-backdrop.is-open .etg-auth-modal {
  transform: translateY(0) scale(1);
}
.etg-auth-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 36px; height: 36px; border: 0;
  border-radius: 50%; background: rgba(255,255,255,.2);
  color: #fff; font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 520px) {
  .etg-auth-page { padding: 0; align-items: flex-end; }
  .etg-auth-card {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    min-height: 65vh;
  }
  .etg-auth-brand { padding: 28px 24px 24px; }
  .etg-auth-brand h1 { font-size: 22px; }
  .etg-auth-body { padding: 8px 24px 36px; }
  .etg-auth-card-footer { padding: 0 24px 32px; }
  .etg-form-input { height: 48px; font-size: 16px; }
  .etg-auth-submit { height: 54px; font-size: 17px; }
  .etg-social-row { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .etg-auth-body { padding: 6px 16px 28px; }
  .etg-auth-brand { padding: 24px 20px 20px; }
  .etg-auth-card-footer { padding: 0 16px 24px; }
}
