/*
 * Mangal Credit & Fincorp Ltd - PayNow Portal
 * Premium Design System
 * ==========================================
 */

/* ==========================================
   CSS Variables
   ========================================== */
:root {
    /* Primary Brand Colors */
    --primary: #d30101;
    --primary-dark: #b50000;
    --primary-light: #ff1a1a;
    --primary-subtle: rgba(211, 1, 1, 0.08);
    --primary-hover: rgba(211, 1, 1, 0.12);

    /* Neutral Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Semantic Colors */
    --success: #0d9f4f;
    --success-subtle: rgba(13, 159, 79, 0.1);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --danger: #dc2626;
    --danger-subtle: rgba(220, 38, 38, 0.1);
    --info: #0ea5e9;

    /* Loan Type Colors */
    --gold: #d97706;
    --gold-subtle: rgba(217, 119, 6, 0.12);
    --blue: #2563eb;
    --blue-subtle: rgba(37, 99, 235, 0.12);
    --green: #059669;
    --green-subtle: rgba(5, 150, 105, 0.12);

    /* Typography */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ==========================================
   Base Styles
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Top Accent Line
   ========================================== */
.top-accent-line {
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

/* ==========================================
   Header Styles
   ========================================== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 4px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    height: 44px;
    width: auto;
    transition: transform var(--transition-base);
}

.header-logo:hover {
    transform: scale(1.02);
}

/* User Dropdown */
.btn-user-dropdown {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--gray-700);
    transition: all var(--transition-base);
}

.btn-user-dropdown:hover,
.btn-user-dropdown:focus {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-user-dropdown .chevron-icon {
    font-size: 0.75rem;
    transition: transform var(--transition-base);
}

.btn-user-dropdown[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-subtle);
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    flex: 1;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

/* ==========================================
   Footer Styles
   ========================================== */
.main-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    margin-top: auto;
}

.footer-main {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    margin-bottom: var(--space-md);
}

.footer-logo {
    height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: var(--space-sm);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--primary-light);
    font-weight: 500;
    margin: 0;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--gray-300);
    text-decoration: none;
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.footer-heading {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-md);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--gray-400);
}

.footer-contact li i {
    color: var(--primary-light);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.footer-contact li a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-contact li a:hover {
    color: var(--white);
}

.footer-bottom {
    padding: var(--space-lg) 0;
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.footer-rbi {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.footer-payments {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .footer-payments {
        justify-content: flex-end;
    }
}

.payment-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.payment-icon-footer {
    height: 24px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.payment-method-icon {
    font-size: 1.5rem;
    color: var(--gray-400);
}

/* Footer Bottom Space */
.footer-bottom-space {
    height: 20px;
    background: var(--gray-900);
}

/* Responsive Footer */
@media (max-width: 991px) {
    .footer-main {
        padding: var(--space-xl) 0;
    }
}

@media (max-width: 767px) {
    .footer-heading {
        margin-top: var(--space-md);
    }

    .footer-bottom {
        text-align: center;
    }

    .footer-payments {
        margin-top: var(--space-md);
        justify-content: center;
    }
}

/* ==========================================
   Animation Classes
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ==========================================
   Login & OTP Sections
   ========================================== */
.login-section,
.otp-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-3xl) 0 var(--space-2xl);
}

/* Login Card */
.login-card,
.otp-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    padding: var(--space-2xl);
    border: 1px solid var(--gray-200);
}

.login-card-header,
.otp-card-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-icon-wrapper,
.otp-icon-wrapper {
    width: 72px;
    height: 72px;
    background: var(--primary-subtle);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.login-icon-wrapper i,
.otp-icon-wrapper i {
    font-size: 2rem;
    color: var(--primary);
}

.login-title,
.otp-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

.login-subtitle,
.otp-subtitle {
    color: var(--gray-600);
    margin-bottom: 0;
    font-size: 0.9375rem;
}

.otp-mobile {
    color: var(--gray-900);
    font-weight: 600;
}

/* Login Tabs */
.login-tabs-wrapper {
    margin-bottom: var(--space-xl);
}

.login-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: var(--radius-lg);
    width: 100%;
}

.login-tabs .nav-item {
    flex: 1;
    width: 50%;
}

.login-tab {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.login-tab:hover {
    color: var(--gray-800);
    background: rgba(0, 0, 0, 0.03);
}

.login-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-tab i {
    font-size: 1rem;
}

/* Form Styles */
.form-floating-custom {
    margin-bottom: var(--space-lg);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 1.125rem;
    z-index: 2;
    pointer-events: none;
    transition: color var(--transition-base);
}

.custom-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem !important;
    padding-left: 3rem !important;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: all var(--transition-base);
}

.custom-input::placeholder {
    color: var(--gray-500);
}

.custom-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

.floating-label {
    display: none;
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Primary Button */
.btn-primary-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 1, 1, 0.3);
}

.btn-primary-custom:active {
    transform: translateY(0);
    color: var(--white);
}

.btn-primary-custom:focus {
    color: var(--white);
    outline: none;
    box-shadow: 0 0 0 4px rgba(211, 1, 1, 0.2);
}

.btn-primary-custom .btn-icon {
    transition: transform var(--transition-base);
}

.btn-primary-custom:hover .btn-icon {
    transform: translateX(4px);
}

/* Security Badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.security-badge i {
    color: var(--success);
}

/* ==========================================
   OTP Input Styles
   ========================================== */
.otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.otp-input {
    width: 60px;
    height: 64px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: all var(--transition-base);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

.otp-input.filled {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-200);
}

.resend-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.btn-resend {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.btn-resend:hover:not(:disabled) {
    background: var(--primary-subtle);
}

.btn-resend:disabled {
    color: var(--gray-500);
    cursor: not-allowed;
}

.resend-timer {
    color: var(--gray-500);
    font-weight: 400;
    margin-left: var(--space-xs);
}

/* Back Link */
.back-link-wrapper {
    text-align: center;
    margin-top: var(--space-lg);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-back:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

/* ==========================================
   Dashboard Section
   ========================================== */
.dashboard-section {
    padding: var(--space-lg) 0 var(--space-3xl);
}

/* Welcome Card */
.welcome-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl) var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--gray-200);
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

.welcome-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    color: var(--gray-600);
    font-size: 0.9375rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.meta-item i {
    font-size: 1rem;
}

.meta-separator {
    color: var(--gray-400);
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    background: var(--success-subtle);
    color: var(--success);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(13, 159, 79, 0.2);
}

/* Loans Header */
.loans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.loans-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.loans-title i {
    color: var(--primary);
}

.loans-count {
    background: var(--gray-800);
    color: var(--white);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Loan Card */
.loan-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

.loan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.loan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.loan-type-badge {
    display: inline-flex;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
}

.badge-gold {
    background: var(--gold-subtle);
    color: var(--gold);
}

.badge-blue {
    background: var(--blue-subtle);
    color: var(--blue);
}

.badge-green {
    background: var(--green-subtle);
    color: var(--green);
}

.loan-status {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    background: var(--success-subtle);
    color: var(--success);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.loan-number {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-lg);
}

.loan-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.detail-value {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.detail-value.text-danger {
    color: var(--primary) !important;
}

.detail-value.text-warning {
    color: var(--warning) !important;
}

/* Loan Card Actions */
.loan-card-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: auto;
}

.btn-pay-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-pay-now:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 1, 1, 0.3);
}

.btn-pay-now:active,
.btn-pay-now:focus {
    color: var(--white);
    outline: none;
}

.btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-view-details:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* Info Card */
.info-card {
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    border: 1px solid var(--gray-200);
}

.info-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.info-title i {
    color: var(--primary);
}

.info-text {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

.info-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.info-link:hover {
    text-decoration: underline;
}

.payment-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
}

.payment-icon {
    height: 28px;
    width: auto;
}

.payment-icon-bi {
    font-size: 2rem;
    color: var(--gray-500);
}

/* ==========================================
   Modal Styles
   ========================================== */
.custom-modal {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.custom-modal .modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-lg) var(--space-xl);
}

.custom-modal .modal-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.custom-modal .modal-body {
    padding: var(--space-lg) var(--space-xl);
}

.custom-modal .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: var(--space-lg) var(--space-xl);
}

.table-details {
    margin-bottom: 0;
}

.table-details td {
    padding: 0.875rem 0.5rem;
    border-color: var(--gray-200);
    vertical-align: middle;
}

.table-details td:first-child {
    color: var(--gray-600);
}

/* ==========================================
   Alert Styles
   ========================================== */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}

.alert-danger {
    background: var(--danger-subtle);
    color: var(--danger);
}

.alert-success {
    background: var(--success-subtle);
    color: var(--success);
}

/* ==========================================
   Form Control Overrides
   ========================================== */
.form-control {
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-300);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    transition: all var(--transition-base);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

.form-control[readonly] {
    background: var(--gray-100);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.input-group-text {
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    font-weight: 600;
    color: var(--gray-600);
}

.input-group .form-control {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.invalid-feedback {
    font-size: 0.8125rem;
    margin-top: var(--space-sm);
}

/* ==========================================
   Button Overrides
   ========================================== */
.btn-secondary {
    background: var(--gray-200);
    border: none;
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
}

.btn-secondary:hover {
    background: var(--gray-300);
    color: var(--gray-800);
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 768px) {
    .login-card,
    .otp-card {
        padding: var(--space-xl);
    }

    .login-title,
    .otp-title {
        font-size: 1.375rem;
    }

    .login-tab span {
        font-size: 0.8125rem;
    }

    .otp-input {
        width: 52px;
        height: 56px;
        font-size: 1.25rem;
    }

    .welcome-card {
        padding: var(--space-lg);
    }

    .welcome-title {
        font-size: 1.375rem;
    }

    .loan-card {
        padding: var(--space-lg);
    }

    .footer-bottom-space {
        height: 40px;
    }
}

@media (max-width: 576px) {
    .otp-inputs-wrapper {
        gap: var(--space-sm);
    }

    .otp-input {
        width: 48px;
        height: 52px;
    }

    .login-tab {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }

    .login-tab i {
        font-size: 1rem;
    }
}

/* ==========================================
   Loading States
   ========================================== */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary-custom.loading::after,
.btn-pay-now.loading::after {
    border-top-color: var(--white);
}

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

/* ==========================================
   Loan Details Page
   ========================================== */
.loan-details-section {
    padding: var(--space-lg) 0 var(--space-3xl);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.btn-download-soa-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-base);
}

.btn-download-soa-header:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 1, 1, 0.25);
}

.btn-download-soa-header i {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-download-soa-header {
        width: 100%;
        justify-content: center;
    }
}

.btn-back-page {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0;
    margin-bottom: var(--space-md);
    transition: color var(--transition-base);
}

.btn-back-page:hover {
    color: var(--primary);
}

.page-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* Loan Summary Card */
.loan-summary-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    border: 1px solid var(--gray-200);
}

.loan-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.loan-number-large {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.loan-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.loan-status-badge.status-active {
    background: var(--success-subtle);
    color: var(--success);
}

.loan-amount-display {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.amount-item {
    flex: 1;
    min-width: 150px;
}

.amount-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.amount-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.amount-divider {
    width: 1px;
    background: var(--gray-200);
    align-self: stretch;
}

.pay-now-section {
    text-align: center;
    padding: var(--space-lg);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.btn-pay-now-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-pay-now-large:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 1, 1, 0.3);
}

.btn-pay-now-large:active,
.btn-pay-now-large:focus {
    color: var(--white);
    outline: none;
}

.pay-now-note {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: var(--space-sm) 0 0;
}

/* Progress Section */
.loan-progress-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-weight: 500;
    color: var(--gray-700);
}

.progress-percent {
    font-weight: 600;
    color: var(--success);
}

.progress-bar-wrapper {
    height: 10px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* Detail Cards */
.detail-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-200);
    height: 100%;
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
}

.detail-card-header i {
    font-size: 1.25rem;
    color: var(--primary);
}

.detail-card-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.detail-card-body {
    padding: var(--space-lg) var(--space-xl);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.highlight {
    background: var(--gray-50);
    margin: 0 calc(var(--space-xl) * -1);
    padding: 0.75rem var(--space-xl);
}

.detail-row .detail-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.detail-row .detail-value {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    text-align: right;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.contact-link:hover {
    opacity: 0.8;
    color: var(--primary);
}

/* Payment History */
.payment-history-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.payment-history-table {
    margin: 0;
}

.payment-history-table thead {
    background: var(--gray-50);
}

.payment-history-table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border: none;
}

.payment-history-table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-color: var(--gray-100);
}

.payment-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-success {
    background: var(--success-subtle);
    color: var(--success);
}

.payment-history-table code {
    font-size: 0.8125rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Responsive for Loan Details */
@media (max-width: 991px) {
    .amount-divider {
        display: none;
    }

    .pay-now-section {
        margin-top: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .loan-number-large {
        font-size: 1.25rem;
    }

    .amount-value {
        font-size: 1.125rem;
    }

    .loan-summary-card,
    .detail-card {
        padding: var(--space-lg);
    }

    .detail-card-header,
    .detail-card-body {
        padding: var(--space-md);
    }

    .detail-row.highlight {
        margin: 0 calc(var(--space-md) * -1);
        padding: 0.75rem var(--space-md);
    }
}

/* ==========================================
   Top Up Banner
   ========================================== */
.top-up-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.75rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
}

.top-up-banner i {
    font-size: 1rem;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(5, 150, 105, 0.5);
    }
}

/* ==========================================
   Download SOA Button (Dashboard)
   ========================================== */
.loan-card-secondary-actions {
    display: flex;
    flex-direction: row !important;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-view-details,
.btn-download-soa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-base);
    flex: 1;
    white-space: nowrap;
}

.btn-view-details:hover,
.btn-download-soa:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
    transform: translateY(-1px);
}

.btn-view-details i,
.btn-download-soa i {
    font-size: 0.875rem;
}

/* ==========================================
   Bottom Actions (Loan Details Page)
   ========================================== */
.bottom-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 2rem 0;
}

.btn-download-soa-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-base);
    min-width: 200px;
}

.btn-download-soa-large:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-download-soa-large i {
    font-size: 1.125rem;
}

.btn-back-dashboard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-200);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-base);
}

.btn-back-dashboard:hover {
    background: var(--gray-300);
    color: var(--gray-800);
}

.btn-back-dashboard i {
    font-size: 1rem;
    transition: transform var(--transition-base);
}

.btn-back-dashboard:hover i {
    transform: translateX(-3px);
}

/* ==========================================
   Payment Success Page
   ========================================== */
.success-section {
    padding: var(--space-2xl) 0 var(--space-3xl);
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.success-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    text-align: center;
    border: 1px solid var(--gray-200);
}

.success-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-xl);
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: success-bounce 0.6s ease;
}

.success-icon i {
    font-size: 3rem;
    color: var(--white);
}

.success-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #10b981;
    animation: ripple 1.5s ease-out infinite;
}

@keyframes success-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

.success-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

.success-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: var(--space-xl);
}

.transaction-details {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.transaction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.transaction-row:last-child {
    border-bottom: none;
}

.transaction-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.transaction-value {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.transaction-value code {
    font-size: 0.8125rem;
    background: var(--gray-200);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
}

.transaction-value.amount-paid {
    color: var(--success);
    font-size: 1.125rem;
}

.receipt-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-md);
    background: var(--success-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
    color: var(--success);
}

.receipt-note i {
    font-size: 1.125rem;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.success-actions .btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-outline-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-outline-custom:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* ==========================================
   Modal Footer Inline
   ========================================== */
.modal-footer-inline {
    display: flex;
    flex-direction: row !important;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-footer-inline .btn {
    flex: 1;
    max-width: 150px;
}

.modal-footer-inline .btn-secondary {
    background: var(--gray-200);
    border: none;
    color: var(--gray-700);
}

.modal-footer-inline .btn-secondary:hover {
    background: var(--gray-300);
    color: var(--gray-900);
}

/* ==========================================
   Utilities
   ========================================== */
.text-primary {
    color: var(--primary) !important;
}

.bg-success {
    background: var(--success) !important;
}
