/* RS Custom Portal Styles */
.rs-portal-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  padding: 20px;
  font-family: 'Rubik', sans-serif;
  flex: 1;
}

.portal-page-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.portal-main {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

/* Main Form Container */
.form-container {
  background-color: #ffffff;
  max-width: 28rem;
  width: 100%;
  margin: 1rem;
  padding: 3.5rem;
  border: 2px solid #3B82F6;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Heading */
.form-container h1 {
  font-size: 1.5rem;
  /* text-2xl */
  line-height: 2rem;
  font-weight: 700;
  /* font-bold */
  text-align: center;
  /* text-center */
  margin-bottom: 2rem;
  /* mb-8 */
}

/* Form Fields Container */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  /* space-y-5 */
}

/* Input Fields */
.form-fields input[type="text"],
.form-fields input[type="email"],
.form-fields input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  /* px-4 py-3 */
  border: 1px solid #D1D5DB;
  /* border border-gray-300 */
  border-radius: 0.5rem;
  /* rounded-lg */
  text-align: right;
  color: #111827;
  /* text-gray-900 */
  transition: all 0.2s ease-in-out;
}

.form-fields input::placeholder {
  color: #6B7280;
  /* placeholder-gray-500 */
}

.form-fields input:focus {
  outline: none;
  border-color: transparent;
  /* focus:border-transparent */
  --tw-ring-color: #3B82F6;
  /* focus:ring-blue-500 */
  box-shadow: 0 0 0 2px var(--tw-ring-color);
  /* focus:ring-2 */
}

/* Toggle Buttons Container */
.toggle-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  /* gap-4 */
  margin-top: 2rem;
  /* my-8 */
  margin-bottom: 2rem;
}

/* Custom styles for radio button labels */
/* This hides the actual radio button */
input[type="radio"].peer {
  display: none;
}

/* This styles the label (the button) */
.radio-btn-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 7rem;
  height: 7rem;
  border: 1px solid #000000;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background-color: white;
  color: #374151;
  /* text-gray-700 */
}

/* This styles the label when the associated radio button is checked */
input[type="radio"].peer:checked+.radio-btn-label {
  border-color: #000000;
  background-color: #5381FC;
  color: #FFFFFF;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

input[type="radio"].peer:hover+.radio-btn-label {
  border-color: #5381FC;
  background-color: #5381FC;
  color: #FFFFFF;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.radio-btn-label svg {
  width: 2rem;
  /* w-10 */
  height: 2rem;
  /* h-10 */
  margin-bottom: 0.5rem;
  /* mb-2 */
}

.radio-btn-label span {
  font-weight: 600;
  /* font-semibold */
}

.portal-message {
  padding: 0 0.75rem;
}

.error {
  font-weight: 500;
  color: #EF4444;
}

hr.divider-line {
  border: 0;
  border-top: 1px solid #E5E7EB;
  /* border-gray-200 */
  margin: 1.5rem 0;
  /* mb-6 */
}

/* Submit Button */
.submit-btn {
  width: 100%;
  background-color: #5381FC;
  color: #ffffff;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.submit-btn:hover {
  background-color: #1D4ED8;
}

.submit-btn[disabled] {
  background-color: #A3BCFF;
}

.submit-btn:focus {
  outline: none;
  --tw-ring-color: #3B82F6;
  /* focus:ring-blue-500 */
  --tw-ring-offset-width: 2px;
  --tw-ring-offset-color: #fff;
  box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color), 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  /* focus:ring-2 focus:ring-offset-2 */
}

/* Dashboard Styles */
.rs-dashboard-wrapper {
  background: #f5f5f5;
}

.rs-inner-wrapper {
  max-width: 1235px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

.otp-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  direction: ltr;
}

#otp-message {
  text-align: center;
  margin: 1rem 0 2rem;
  height: 32px;
}

.otp-input {
  width: 3.5rem !important;
  /* 56px */
  height: 3.5rem;
  /* 56px */
  text-align: center;
  font-size: 1.5rem;
  /* 24px */
  font-weight: 700;
  color: #111827;
  /* Replaced box with dash style */
  border: none !important;
  border-bottom: 2px solid #374151 !important;
  /* gray-700 */
  background: transparent;
  border-radius: 0 !important;
  /* No radius for underline */
  transition: all 0.2s ease-in-out !important;
  padding-left: 0.5rem !important;
  /* Center the single character */
  padding-right: 0.5rem !important;
}

.otp-input:focus {
  outline: none;
  border-bottom-color: #3B82F6;
  /* blue-500 */
  box-shadow: none;
  /* No ring shadow */
}

.button-container {
  display: flex;
  flex-direction: row-reverse;
  /* Flips order to match LTR visual */
  justify-content: center;
  gap: 1rem;
  /* 16px */
  margin-bottom: 1.5rem;
  /* mb-6 */
}

/* Override w-full for side-by-side buttons */
.button-container .submit-btn,
.button-container .outline-btn {
  width: auto;
  padding-left: 2rem;
  /* 32px */
  padding-right: 2rem;
  /* 32px */
}

/* New Outline Button Style */
.outline-btn {
  background-color: #ffffff;
  color: #5381FC;
  /* text-blue-600 */
  font-weight: 700;
  padding: 0.75rem 1rem;
  /* py-3 px-4 */
  border: 2px solid #5381FC;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.outline-btn:hover {
  background-color: #EFF6FF;
  /* bg-blue-50 */
}

.outline-btn:focus {
  outline: none;
  --tw-ring-color: #3B82F6;
  --tw-ring-offset-width: 2px;
  --tw-ring-offset-color: #fff;
  box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color), 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
}

/* Divider Line (Same as before) */
hr {
  border: 0;
  border-top: 1px solid #E5E7EB;
  /* border-gray-200 */
}

/* Profile Header */
.dashboard-profile-header {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5B9CF5 0%, #4A90E2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
}

.profile-info {
  flex-grow: 1;
  text-align: right;
}

.profile-name {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.profile-line {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* Info Cards Section */
.dashboard-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.info-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E9ECEF;
}

.card-icon {
  font-size: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.card-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-link {
  color: #5B9CF5;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.card-link:hover {
  color: #4A90E2;
  text-decoration: underline;
}

.card-contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 8px;
  background: #F8F9FA;
  border-radius: 6px;
}

.contact-label {
  min-width: 50px;
  color: #666;
}

.contact-value {
  flex-grow: 1;
  color: #333;
  font-weight: 500;
}

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

/* Credit Score Cards */
.credit-score-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.score-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.score-card:hover {
  transform: translateY(-2px);
}

.score-value {
  font-size: 36px;
  font-weight: 700;
  color: #22C55E;
  margin-bottom: 8px;
}

.score-value.rejected {
  color: #DC3545;
}

.score-label {
  font-size: 13px;
  color: #666;
  line-height: 1.3;
}

/* Actions Section */
.dashboard-actions-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.actions-header {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.btn-primary-action {
  background: #5B9CF5;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-secondary {
  background: #DC4C64;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.ghost-dangr {
  background: transparent;
  color: #DC4C64;
  border: 0 none;
  text-decoration: underline;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn-primary-action:hover {
  background: #4A90E2;
}

.search-box {
  flex-grow: 1;
  display: flex;
  gap: 8px;
  position: relative;
}

.search-box input {
  flex-grow: 1;
  padding: 10px 45px 10px 16px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: #5B9CF5;
}

.search-btn {
  padding: 16px;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  border: 0 none;
}

.search-btn:hover {
  background: #EEEEEE;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.filter-tab {
  padding: 8px 20px;
  border: 1px solid #E0E0E0;
  background: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: #F5F5F5;
}

.filter-tab.active {
  background: #5B9CF5;
  color: white;
  border-color: #5B9CF5;
}

/* Data Table */
.data-table-container {
  overflow-x: auto;
}

.mobile-cards-container {
  display: none;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dashboard-table thead {
  border-bottom: 2px solid #D5D9DD;
}

.dashboard-table th {
  padding: 12px;
  text-align: right;
  font-weight: 600;
  color: #666;
  border: none !important;
}

.dashboard-table th.sortable {
  user-select: none;
  transition: background 0.2s;
}

.dashboard-table th.sortable:hover {
  background: #E9ECEF;
}

.dashboard-table th .sort-icon {
  margin-right: 4px;
  font-size: 12px;
  color: #999;
}

.dashboard-table td {
  padding: 14px 12px;
  border: none;
  color: #333;
}

.dashboard-table tbody tr:hover {
  background: #F8F9FA;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-green {
  background: #D4EDDA;
  color: #22C55E;
}

.status-red {
  background: #F8D7DA;
  color: #DC3545;
}

.status-yellow {
  background: #FFF3CD;
  color: #FFC107;
}

.status-orange {
  background: #FFE5CC;
  color: #FF9800;
}

/* Info Section Bottom */
.info-section-bottom {
  margin-top: 30px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: right;
  margin: 0 0 24px 0;
  color: #333;
}

.info-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.info-card-large {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.card-image img,
.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 24px;
  flex: 1;
}

.card-badge {
  display: inline-block;
  background: #5B9CF5;
  color: white;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.info-card-large h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #333;
  line-height: 1.4;
}

.card-description {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* Mobile Request Cards */
.request-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.request-card-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.request-card-badge.status-green {
  background: #D4EDDA;
  color: #22C55E;
}

.request-card-badge.status-red {
  background: #F8D7DA;
  color: #DC3545;
}

.request-card-badge.status-yellow {
  background: #FFF3CD;
  color: #FFC107;
}

.request-card-badge.status-orange {
  background: #FFE5CC;
  color: #FF9800;
}

.request-card-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #333;
}

.request-card-date {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px 0;
}

.request-card-note {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

/* Loading States */
.rs-portal-form.loading .submit-btn {
  opacity: 0.7;
  cursor: not-allowed;
}

.rs-portal-form.loading .submit-btn:before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

.box {
  display: none;
}

#step2 {
  padding: 2.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Step Animation */
.step-1,
.step-2 {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease;
}

.step-1.slide-out {
  opacity: 0;
  transform: translateX(-20px);
}

.step-2.slide-in {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .portal-page-container {
    padding: 20px 10px;
  }

  .rs-portal-container {
    padding: 16px;
    min-height: 300px;
  }

  .rs-inner-wrapper {
    padding: 15px 0px;
    display: flex;
    flex-direction: column;
  }

  .profile-actions .btn-primary-action {
    display: none;
  }

  .portal-title {
    font-size: 22px;
    margin-bottom: 28px;
  }

  .otp-input-container {
    gap: 8px;
    margin-bottom: 24px;
  }

  .otp-input {
    width: 45px !important;
    height: 45px;
    font-size: 20px;
  }

  .button-group {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .btn-primary {
    padding: 12px;
    font-size: 15px;
  }

  .box {
    display: block;
    padding: 1rem 0;
    text-align: left;
  }

  /* Dashboard Mobile */
  .rs-dashboard-wrapper {
    padding: 12px;
  }

  .dashboard-profile-header {
    text-align: center;
    padding: 20px;
    box-shadow: none;
  }

  .avatar-circle {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .profile-name {
    font-size: 20px;
  }

  .dashboard-info-cards {
    grid-template-columns: 1fr;
  }

  .credit-score-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .score-card {
    padding: 16px;
  }

  .score-value {
    font-size: 28px;
  }

  .score-label {
    font-size: 12px;
  }

  .dashboard-actions-section {
    padding: 0;
  }

  .actions-header {
    flex-direction: column;
    padding: 0 1rem;
    margin: 0;
  }

  .btn-primary-action {
    width: 100%;
  }

  .search-box {
    width: 100%;
    margin: 1rem;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }

  /* Hide table, show cards on mobile */
  .desktop-table {
    display: none;
  }

  .mobile-cards-container {
    display: block;
  }

  .dashboard-table {
    font-size: 12px;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 8px 6px;
  }

  .info-cards-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .portal-page-container {
    padding: 10px 5px;
    background: white;
    padding: 0 15px;
  }

  .rs-portal-container {
    padding: 12px;
  }

  .portal-main {
    display: block;
  }

  .form-container {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .portal-title {
    font-size: 20px;
  }

  .btn-icon {
    min-width: 80px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .otp-input {
    width: 40px !important;
    height: 40px;
    font-size: 18px;
  }

  .rs-dashboard-wrapper {
    padding: 8px;
  }

  .avatar-circle {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .profile-name {
    font-size: 18px;
  }

  .profile-line {
    font-size: 13px;
  }

  .credit-score-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .score-card {
    padding: 12px;
  }

  .score-value {
    font-size: 24px;
  }

  /* Hide table, show cards on mobile */
  .desktop-table {
    display: none;
  }

  .mobile-cards-container {
    display: block;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 6px 4px;
    font-size: 11px;
  }

  .status-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  .info-card-large {
    padding: 16px;
  }
}