/* =============================================
   LOAN APPLICATION - FRONTEND CSS
   ============================================= */

.la-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    position: relative;
}

.la-container * {
    box-sizing: border-box;
}

/* Header */
.la-header {
    background: linear-gradient(135deg, #1a7a3a, #2d8f4e);
    color: white;
    padding: 25px 20px 30px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
}

.la-header h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

/* Steps */
.la-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.la-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.la-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    transition: all 0.3s;
}

.la-step.active .la-step-num {
    background: white;
    color: #1a7a3a;
}

.la-step.completed .la-step-num {
    background: #4caf50;
    color: white;
}

.la-step-label {
    font-size: 11px;
    opacity: 0.8;
}

.la-step.active .la-step-label {
    opacity: 1;
    font-weight: 600;
}

.la-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.3);
    margin: 0 5px;
    margin-bottom: 20px;
}

.la-step-line.active {
    background: white;
}

/* Card */
.la-card {
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.la-card h3 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.la-card h4 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Fields */
.la-field {
    margin-bottom: 16px;
}

.la-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.la-field input,
.la-field select,
.la-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    transition: border-color 0.3s;
    outline: none;
}

.la-field input:focus,
.la-field select:focus,
.la-field textarea:focus {
    border-color: #1a7a3a;
    background: white;
}

.la-field-row {
    display: flex;
    gap: 12px;
}

.la-field-row .la-field {
    flex: 1;
}

.required {
    color: #e74c3c;
}

.la-note {
    font-size: 13px;
    color: #777;
    margin-bottom: 16px;
}

/* =============================================
   UPLOAD BOX
   ============================================= */

.la-upload-box {
    position: relative;
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
    cursor: pointer;
    min-height: 120px;
    background: #fafafa;
}

.la-upload-box:hover {
    border-color: #1a7a3a;
    background: #f5fdf5;
}

.la-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    font-size: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.la-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    text-align: center;
    pointer-events: none;
    min-height: 120px;
}

.la-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.la-upload-placeholder p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.la-upload-placeholder span {
    font-size: 12px;
    color: #999;
}

.la-upload-preview {
    position: relative;
    padding: 10px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.la-upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.la-remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.la-remove-file:hover {
    background: #c0392b;
}

.la-upload-progress {
    padding: 20px;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.la-progress-bar {
    width: 80%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.la-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a7a3a, #4caf50);
    border-radius: 3px;
    animation: la-progress-anim 1.5s infinite;
}

@keyframes la-progress-anim {
    0%   { width: 15%; }
    50%  { width: 85%; }
    100% { width: 15%; }
}

.la-upload-progress span {
    font-size: 13px;
    color: #777;
}

/* =============================================
   LOAN AMOUNT CARDS
   ============================================= */

.la-loan-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.la-amount-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.la-amount-card:hover {
    border-color: #1a7a3a;
    background: #f0faf0;
}

.la-amount-card.selected {
    border-color: #1a7a3a;
    background: #f0faf0;
    box-shadow: 0 0 0 1px #1a7a3a;
}

.la-amount-card strong {
    display: block;
    font-size: 18px;
    color: #222;
    margin-bottom: 4px;
}

.la-amount-card.selected strong {
    color: #1a7a3a;
}

.la-amount-card span {
    font-size: 13px;
    color: #777;
}

/* Custom amount section */
.la-custom-amount-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
}

.la-custom-amount-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #444;
}

.la-custom-amount-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a7a3a;
}

#custom-amount-fields {
    margin-top: 15px;
}

/* Summary Bar */
.la-summary-bar {
    display: flex;
    justify-content: space-between;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-top: 2px solid #e0e0e0;
}

.la-summary-item {
    text-align: center;
}

.la-summary-item span {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 2px;
}

.la-summary-item strong {
    font-size: 16px;
    color: #222;
}

/* =============================================
   BUTTONS
   ============================================= */

.la-btn-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.la-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    flex: 1;
}

.la-btn-next,
.la-btn-submit,
.la-btn-track,
.la-btn-payment-submit {
    background: linear-gradient(135deg, #1a7a3a, #2d8f4e);
    color: white;
}

.la-btn-next:hover,
.la-btn-submit:hover,
.la-btn-track:hover,
.la-btn-payment-submit:hover {
    background: linear-gradient(135deg, #156830, #238a40);
    transform: translateY(-1px);
}

.la-btn-back {
    background: #f0f0f0;
    color: #555;
}

.la-btn-back:hover {
    background: #e0e0e0;
}

.la-btn-outline {
    background: white;
    color: #1a7a3a;
    border: 2px solid #1a7a3a;
}

.la-btn-outline:hover {
    background: #f0faf0;
}

.la-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================================
   SUCCESS PAGE — matches screenshot exactly
   ============================================= */

#loan-success {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #f0f0f0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-y: auto;
}

.la-success-outer {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

/* Back arrow bar */
.la-success-topbar {
    padding: 20px 20px 0;
    flex-shrink: 0;
}

.la-success-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s;
}

.la-success-arrow:hover {
    background: rgba(0,0,0,0.07);
}

/* Centre content */
.la-success-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 28px 30px;
    text-align: center;
}

/* Green circle */
.la-success-circle-wrap {
    margin-bottom: 30px;
}

.la-success-circle {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(46,125,50,0.30);
    animation: la-pop 0.55s cubic-bezier(0.175,0.885,0.32,1.275) both;
}

@keyframes la-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1);   opacity: 1; }
}

.la-success-circle svg {
    animation: la-tick 0.35s ease 0.38s both;
    opacity: 0;
}

@keyframes la-tick {
    0%   { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1);   }
}

/* Title */
.la-success-title {
    font-size: 26px;
    font-weight: 800;
    color: #111;
    line-height: 1.3;
    margin: 0 0 14px;
    letter-spacing: -0.2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Subtitle */
.la-success-sub {
    font-size: 15px;
    color: #888;
    margin: 0 0 28px;
    font-weight: 400;
    line-height: 1.5;
}

/* Info box */
.la-success-infobox {
    background: #e8f5e9;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    width: 100%;
    max-width: 420px;
    animation: la-fadein 0.5s ease 0.55s both;
    opacity: 0;
}

@keyframes la-fadein {
    to { opacity: 1; }
}

.la-success-infobox-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.la-success-infobox-text {
    font-size: 14px;
    font-weight: 700;
    color: #1b3a1c;
    line-height: 1.65;
    margin: 0;
}

/* Bottom button */
.la-success-bottom {
    padding: 0 20px 40px;
    flex-shrink: 0;
}

.la-success-homebtn {
    display: block;
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    background: #2e7d32;
    color: #fff !important;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    text-decoration: none !important;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 20px rgba(46,125,50,0.28);
    transition: background 0.25s, transform 0.15s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.la-success-homebtn:hover {
    background: #1b5e20;
    transform: translateY(-1px);
    color: #fff !important;
}

.la-success-homebtn:active {
    transform: translateY(0);
}

/* =============================================
   LOADING
   ============================================= */

#la-loading,
#track-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.la-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e0e0;
    border-top-color: #1a7a3a;
    border-radius: 50%;
    animation: la-spin 0.8s linear infinite;
    margin-bottom: 14px;
}

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

/* Error */
.la-error-msg {
    background: #fef0f0;
    color: #e74c3c;
    padding: 12px 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 14px;
    border-left: 4px solid #e74c3c;
}

.la-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Footer text */
.la-footer-text {
    text-align: center;
    font-size: 12px;
    color: #bbb;
    margin-top: 20px;
    line-height: 1.5;
}

/* =============================================
   TRACK LOAN STYLES
   ============================================= */

.la-track-title {
    text-align: center;
    color: #1a7a3a;
}

#track-search-section .la-card {
    text-align: center;
}

#track-search-section .la-field {
    text-align: left;
}

.la-status-header {
    background: linear-gradient(135deg, #1a7a3a, #2d8f4e);
    color: white;
    padding: 30px 20px;
    border-radius: 0 0 24px 24px;
    text-align: center;
    margin-bottom: -30px;
    padding-bottom: 60px;
}

.la-status-header h2 {
    margin: 0 0 5px;
    font-size: 24px;
    color: white;
}

.la-status-header > p {
    opacity: 0.85;
    margin: 0 0 20px;
    font-size: 14px;
}

.la-status-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid white;
    background: #ddd;
}

.la-status-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.la-status-name {
    margin: 0 0 10px;
    font-size: 20px;
    color: white;
}

.la-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.la-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f0ad4e;
}

.la-status-badge.approved .la-badge-dot  { background: #4caf50; }
.la-status-badge.rejected .la-badge-dot  { background: #e74c3c; }
.la-status-badge.processing .la-badge-dot{ background: #2196f3; }
.la-status-badge.disbursed .la-badge-dot { background: #4caf50; }

#track-status-text { color: #e6a817; }
.la-status-badge.approved   #track-status-text { color: #4caf50; }
.la-status-badge.rejected   #track-status-text { color: #e74c3c; }
.la-status-badge.processing #track-status-text { color: #2196f3; }
.la-status-badge.disbursed  #track-status-text { color: #4caf50; }

.la-status-details {
    position: relative;
    z-index: 2;
    margin-top: 10px;
}

.la-detail-row {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.la-detail-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.la-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.la-amount-highlight { color: #1a7a3a; }

.la-processing-section {
    background: #f0faf0;
    border-left: 4px solid #f0ad4e;
}

.la-processing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.la-processing-icon { font-size: 18px; }

.la-processing-msg {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
}

.la-processing-msg p { margin: 0; }

.la-payment-account-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 15px;
    color: #333;
}

.la-bar-icon {
    color: #1a7a3a;
    font-weight: 700;
    font-size: 18px;
}

.la-payment-method-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.la-payment-icon { font-size: 24px; }

.la-payment-label {
    display: block;
    font-size: 12px;
    color: #999;
}

.la-payment-details-box {
    background: #f8fdf8;
    border: 1.5px solid #d0e8d0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.la-pay-field { margin-bottom: 12px; }
.la-pay-field:last-child { margin-bottom: 0; }

.la-pay-label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.la-pay-number-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.la-pay-number-row strong {
    font-size: 20px;
    letter-spacing: 1px;
}

.la-copy-btn {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.la-copy-btn:hover { background: #c8e6c9; }

.la-payment-upload { margin-bottom: 18px; }

.la-payment-upload label {
    display: block;
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
}

.la-payment-upload .la-upload-box {
    border-color: #c8e6c9;
    background: #f8fdf8;
}

.la-btn-payment-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: 30px;
}

.la-payment-note {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.la-payment-submitted {
    text-align: center;
    padding: 30px 20px;
}

.la-submitted-icon {
    font-size: 50px;
    margin-bottom: 12px;
}

.la-payment-submitted h3 { color: #333; }

.la-verification-box {
    display: flex;
    gap: 12px;
    text-align: left;
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.la-verification-box span {
    font-size: 20px;
    flex-shrink: 0;
}

.la-verification-box strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.la-verification-box p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.la-track-back {
    text-align: center;
    margin: 20px 0;
}

.la-status-pending   { color: #f0ad4e; }
.la-status-approved  { color: #4caf50; }
.la-status-processing{ color: #2196f3; }
.la-status-rejected  { color: #e74c3c; }
.la-status-disbursed { color: #4caf50; }

.la-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.la-status-dot.pending    { background: #f0ad4e; }
.la-status-dot.approved   { background: #4caf50; }
.la-status-dot.processing { background: #2196f3; }
.la-status-dot.rejected   { background: #e74c3c; }
.la-status-dot.disbursed  { background: #4caf50; }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 500px) {
    .la-container {
        padding: 0 10px;
    }

    .la-header {
        padding: 20px 15px 25px;
    }

    .la-card {
        padding: 20px 16px;
    }

    .la-loan-amounts {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .la-amount-card {
        padding: 14px 8px;
    }

    .la-amount-card strong {
        font-size: 15px;
    }

    .la-field-row {
        flex-direction: column;
        gap: 0;
    }

    .la-success-title {
        font-size: 23px;
    }

    .la-success-circle {
        width: 96px;
        height: 96px;
    }

    .la-success-circle svg {
        width: 44px;
        height: 44px;
    }

    .la-success-bottom {
        padding-bottom: 28px;
    }

    .la-success-homebtn {
        font-size: 16px;
        padding: 16px;
    }
}