/*
 * Client Portal Auth Pages
 * Mobile-first responsive design
 */

/* ─── Base Styles ────────────────────────────────────────────────────────────── */
.cp-auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #f8f9fc 0%, #eef1f8 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.cp-auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  position: relative;
}

/* ─── Back Button ────────────────────────────────────────────────────────────── */
.cp-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a2e;
  text-decoration: none;
  font-size: 18px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.cp-back-btn:hover,
.cp-back-btn:focus {
  background-color: rgba(26, 26, 46, 0.1);
  color: #1a1a2e;
  text-decoration: none;
}

/* ─── Auth Container ─────────────────────────────────────────────────────────── */
.cp-auth-container {
  width: 100%;
  max-width: 400px;
  margin-top: 40px;
}

/* ─── Logo ───────────────────────────────────────────────────────────────────── */
.cp-auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.cp-logo-img {
  height: 50px;
  width: auto;
}

/* ─── Auth Title ─────────────────────────────────────────────────────────────── */
.cp-auth-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 40px;
}

/* ─── Form Styles ────────────────────────────────────────────────────────────── */
.cp-auth-form {
  width: 100%;
}

.cp-form-group {
  margin-bottom: 20px;
}

.cp-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #4a4a68;
  margin-bottom: 8px;
}

.cp-form-input {
  width: 100%;
  height: 50px;
  padding: 12px 16px;
  font-size: 16px;
  color: #1a1a2e;
  background-color: #ffffff;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.cp-form-input:focus {
  outline: none;
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.cp-form-input::placeholder {
  color: #a0a0b0;
}

/* Password input with toggle */
.cp-password-wrapper {
  position: relative;
}

.cp-password-wrapper .cp-form-input {
  padding-right: 50px;
}

.cp-password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #a0a0b0;
  font-size: 18px;
  transition: color 0.2s;
}

.cp-password-toggle:hover {
  color: #1a1a2e;
}

.cp-password-toggle:focus {
  outline: none;
}

/* ─── Forgot Password Link ───────────────────────────────────────────────────── */
.cp-forgot-link-wrapper {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 30px;
}

.cp-forgot-link {
  font-size: 14px;
  color: #4a4a68;
  text-decoration: none;
  transition: color 0.2s;
}

.cp-forgot-link:hover,
.cp-forgot-link:focus {
  color: #1a1a2e;
  text-decoration: none;
}

/* ─── Submit Button ──────────────────────────────────────────────────────────── */
.cp-submit-btn {
  width: 100%;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: #1a1a2e;
  border: none;
  border-radius: 26px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 10px;
}

.cp-submit-btn:hover {
  background-color: #2a2a45;
}

.cp-submit-btn:active {
  transform: scale(0.98);
}

.cp-submit-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.3);
}

.cp-submit-btn:disabled {
  background-color: #a0a0b0;
  cursor: not-allowed;
}

/* ─── Alternative Actions ────────────────────────────────────────────────────── */
.cp-alt-action {
  text-align: center;
  margin-top: 30px;
  font-size: 14px;
  color: #4a4a68;
}

.cp-alt-action a {
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.cp-alt-action a:hover,
.cp-alt-action a:focus {
  color: #2a2a45;
  text-decoration: underline;
}

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.cp-alert {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-alert.alert-success {
  background-color: #e8f5e9;
  border-color: #c8e6c9;
  color: #2e7d32;
}

.cp-alert.alert-danger {
  background-color: #ffebee;
  border-color: #ffcdd2;
  color: #c62828;
}

/* ─── Error Messages ─────────────────────────────────────────────────────────── */
.cp-error-list {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.cp-error-list h4 {
  color: #c62828;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.cp-error-list ul {
  margin: 0;
  padding-left: 20px;
}

.cp-error-list li {
  color: #c62828;
  font-size: 13px;
  margin-bottom: 4px;
}

/* ─── Name Row (for signup) ──────────────────────────────────────────────────── */
.cp-name-row {
  display: flex;
  gap: 15px;
}

.cp-name-row .cp-form-group {
  flex: 1;
}

/* ─── Divider ────────────────────────────────────────────────────────────────── */
.cp-divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
}

.cp-divider::before,
.cp-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: #e0e0e8;
}

.cp-divider span {
  padding: 0 15px;
  font-size: 13px;
  color: #a0a0b0;
}

/* ─── Social Buttons ─────────────────────────────────────────────────────────── */
.cp-social-btn {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a2e;
  background-color: #ffffff;
  border: 1px solid #e0e0e8;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.cp-social-btn:hover {
  background-color: #f5f5f8;
  border-color: #d0d0d8;
  color: #1a1a2e;
  text-decoration: none;
}

.cp-social-btn img {
  width: 20px;
  height: 20px;
}

/* ─── Terms Text ─────────────────────────────────────────────────────────────── */
.cp-terms-text {
  font-size: 12px;
  color: #a0a0b0;
  text-align: center;
  margin-top: 20px;
  line-height: 1.5;
}

.cp-terms-text a {
  color: #4a4a68;
  text-decoration: underline;
}

/* ─── Responsive Styles ──────────────────────────────────────────────────────── */

/* Mobile (default) */
@media (max-width: 575px) {
  .cp-auth-wrapper {
    padding: 15px;
    padding-top: 60px; /* Space for back button */
  }

  .cp-auth-container {
    margin-top: 20px;
  }

  .cp-auth-title {
    font-size: 18px;
    margin-bottom: 30px;
  }

  .cp-logo-img {
    height: 40px;
  }
}

/* Tablet */
@media (min-width: 576px) and (max-width: 991px) {
  .cp-auth-wrapper {
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .cp-auth-container {
    margin-top: 0;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }
}

/* Desktop */
@media (min-width: 992px) {
  .cp-auth-wrapper {
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .cp-auth-container {
    margin-top: 0;
    background: #ffffff;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  }

  .cp-back-btn {
    display: none;
  }

  .cp-logo-img {
    height: 55px;
  }

  .cp-auth-title {
    font-size: 22px;
  }
}
