/* ==========================================================================
   My First Credit — Customer portal & auth
   ========================================================================== */

:root {
    --green-dark: #1f2d3d;
    --green: #00A896;
    --green-rgb: 0, 168, 150;
    --gold: #ff9105;
    --gold-soft: #ffe0b3;
    --white: #FFFFFF;
    --bg-soft: #f4fbfa;
    --text: #1f2d3d;
    --text-muted: #5b6b7a;
    --border: rgba(var(--green-rgb), 0.14);
    --radius-card: 20px;
    --radius-input: 12px;
    --radius-btn: 12px;
    --shadow-sm: 0 2px 8px rgba(31, 45, 61, 0.06);
    --shadow-md: 0 8px 24px rgba(31, 45, 61, 0.08);
    --shadow-lg: 0 16px 40px rgba(31, 45, 61, 0.12);
    --transition: 0.2s ease;
    --font: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.cp-auth-body,
body.cp-shell {
    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Auth pages (login, forgot password, OTP)
   -------------------------------------------------------------------------- */
.cp-auth-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 18% 0%, rgba(var(--green-rgb), 0.14), transparent 55%),
        radial-gradient(ellipse at 88% 100%, rgba(243, 108, 33, 0.08), transparent 50%),
        var(--bg-soft);
}

.cp-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.cp-auth-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.cp-auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    padding: 32px 28px 28px;
    overflow: hidden;
    position: relative;
}

.cp-auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0b3d2e, #1a6b4f 55%, #f36c21);
}

.cp-auth-logo {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.cp-auth-logo a {
    display: inline-block;
    line-height: 0;
}

.cp-auth-logo img {
    display: block;
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain;
    margin: 0 auto;
}

.cp-auth-foot {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cp-auth-back {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.cp-auth-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 20px;
    line-height: 1.45;
}

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

.cp-status-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.cp-status-icon--warn {
    background: #FEF3C7;
    color: #B45309;
}

/* --------------------------------------------------------------------------
   Shared cards & form controls
   -------------------------------------------------------------------------- */
.cp-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
    padding: 36px 32px;
}

.cp-field {
    margin-bottom: 16px;
}

.cp-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.cp-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.cp-card-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cp-card-sub a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}

.cp-card-sub a:hover {
    color: var(--green-dark);
}

.cp-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 8px;
}

.cp-input,
.cp-select,
.cp-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.cp-input::placeholder {
    color: #9CA3AF;
}

.cp-input:-webkit-autofill,
.cp-input:-webkit-autofill:hover,
.cp-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: var(--text);
    transition: background-color 5000s ease-in-out 0s;
}

.cp-input:focus,
.cp-select:focus,
.cp-textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.15);
}

.cp-input.is-invalid {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.cp-field-error {
    display: none;
    color: #DC2626;
    font-size: 0.8rem;
    margin-top: 6px;
    line-height: 1.35;
}

.cp-input.is-invalid + .cp-field-error,
.cp-input.is-invalid ~ .cp-field-error,
.cp-field-error.is-visible {
    display: block;
}

.cp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
}

.cp-check input {
    accent-color: var(--green);
}

.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 22px;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(145deg, #1a6b4f, #0b3d2e);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(26, 107, 79, 0.22);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.cp-btn:hover {
    background: linear-gradient(145deg, #0b3d2e, #145c44);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(26, 107, 79, 0.3);
}

.cp-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cp-btn-outline {
    background: transparent;
    border: 1.5px solid var(--green);
    color: var(--green);
    box-shadow: none;
}

.cp-btn-outline:hover {
    background: var(--green);
    color: #fff;
    box-shadow: none;
}

.cp-btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.cp-link {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.88rem;
}

.cp-link:hover {
    color: var(--green-dark);
    text-decoration: underline;
}

.cp-alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    margin-bottom: 18px;
    line-height: 1.45;
}

.cp-alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.cp-alert-success {
    background: #e8f5ef;
    color: #0b3d2e;
    border: 1px solid #b7e0cc;
}

.cp-muted {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Portal shell (logged-in dashboard)
   -------------------------------------------------------------------------- */
.cp-shell {
    background: var(--bg-soft);
    min-height: 100vh;
}

.cp-container {
    max-width: 1200px;
}

.cp-topbar {
    background: linear-gradient(135deg, var(--green-dark) 0%, #1a6b4f 100%);
    color: #fff;
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.cp-topbar__wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.cp-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.cp-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.cp-topbar__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    max-width: 200px;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
    background: var(--white);
    padding: 6px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform var(--transition);
}

.cp-topbar__brand:hover {
    transform: translateY(-1px);
}

.cp-topbar__brand img {
    display: block !important;
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: 160px !important;
    object-fit: contain !important;
}

.cp-topbar__badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.cp-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}

.cp-topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.cp-topbar__link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cp-topbar__link--active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.cp-topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cp-topbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cp-topbar__name {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.cp-body {
    padding: 32px 0 56px;
}

.cp-mobile-menu {
    width: 100%;
}

.cp-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border: none;
    border-radius: var(--radius-btn);
    background: var(--green-dark);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    font-family: var(--font);
}

.cp-menu-toggle__label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cp-menu-toggle__label i {
    color: var(--gold);
    font-size: 1.1rem;
}

.cp-menu-toggle > .fa-chevron-right {
    color: var(--gold-soft);
    font-size: 0.85rem;
}

.cp-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.35);
}

.cp-drawer {
    width: min(86vw, 340px) !important;
    border: none;
}

.cp-drawer__header {
    background: var(--green-dark);
    color: #fff;
    padding: 18px 20px;
}

.cp-drawer__header .offcanvas-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
}

.cp-drawer__body {
    background: #fff;
    padding: 12px !important;
}

.cp-drawer__body .cp-nav .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
}

.cp-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    position: sticky;
    top: 20px;
}

.cp-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-nav .nav-item {
    margin-bottom: 4px;
}

.cp-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background var(--transition), color var(--transition);
}

.cp-nav .nav-link i {
    width: 18px;
    color: var(--green);
    text-align: center;
    font-size: 0.95rem;
}

.cp-nav .nav-link:hover,
.cp-nav .nav-link.active {
    background: rgba(var(--green-rgb), 0.08);
    color: var(--green-dark);
}

.cp-nav .nav-link.logout {
    color: #B91C1C;
    margin-top: 8px;
}

.cp-nav .nav-link.logout i {
    color: #B91C1C;
}

.cp-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 20px;
}

.cp-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 20px;
    line-height: 1.35;
}

.cp-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 10px;
}

.cp-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.cp-otp-digit,
.cp-otp-inputs input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font);
}

.cp-otp-digit:focus,
.cp-otp-inputs input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.15);
}

/* Membership card */
.cp-member-card {
    max-width: 100%;
    margin: 0 auto 24px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #06261c 0%, #0b3d2e 40%, #1a6b4f 100%);
    color: #fff;
    padding: 28px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.cp-member-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.cp-member-card .card-type {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold-soft);
    font-weight: 600;
    text-align: right;
    max-width: 50%;
    line-height: 1.35;
}

.cp-member-card .card-number {
    font-size: 1.3rem;
    letter-spacing: 0.14em;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cp-member-card .card-number span {
    display: inline-block;
}

.cp-member-card .card-name {
    font-size: 1.05rem;
    text-transform: uppercase;
    font-weight: 600;
}

.cp-member-card .card-valid {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
}

.cp-download-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.cp-download-row a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92rem;
    padding: 8px 14px;
    border: 1px solid rgba(var(--green-rgb), 0.25);
    border-radius: 10px;
    background: rgba(var(--green-rgb), 0.06);
    transition: background var(--transition), color var(--transition);
}

.cp-download-row a:hover {
    background: rgba(var(--green-rgb), 0.12);
    color: var(--green-dark);
}

.cp-doc-list {
    text-align: left;
}

.cp-doc-list .list-group-item {
    border-color: var(--border);
    padding: 16px 0;
    background: transparent;
}

.cp-doc-list h5,
.cp-doc-heading {
    font-size: 0.95rem;
    color: var(--green-dark);
    font-weight: 600;
    margin-bottom: 6px;
}

.cp-notif-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--green-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
}

.cp-table th,
.cp-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
    text-align: left;
}

.cp-table th {
    color: var(--green-dark);
    font-weight: 600;
    background: rgba(var(--green-rgb), 0.05);
}

.cp-kyc-error {
    color: #B91C1C;
    font-size: 0.8rem;
    margin-top: 4px;
}

.cp-offer-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    background: #fff;
}

.cp-offer-item span {
    font-weight: 600;
    color: var(--green-dark);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .cp-auth-page {
        padding: 24px 16px;
    }

    .cp-card {
        padding: 28px 22px;
    }

    .cp-card-title {
        font-size: 1.35rem;
    }

    .cp-topbar__badge {
        display: none;
    }

    .cp-topbar__brand {
        max-width: 160px;
        padding: 5px 10px;
        height: 40px;
    }

    .cp-topbar__brand img {
        height: 28px !important;
        max-height: 28px !important;
        max-width: 130px !important;
    }

    .cp-topbar__name {
        max-width: 90px;
        font-size: 0.78rem;
    }

    .cp-topbar__link span {
        display: none;
    }

    .cp-body {
        padding: 20px 0 40px;
    }

    .cp-panel {
        padding: 20px 16px;
    }

    .cp-page-title {
        font-size: 1.15rem;
        margin-bottom: 16px;
    }

    .cp-member-card {
        padding: 20px 18px;
        border-radius: 14px;
    }

    .cp-member-card .card-number {
        font-size: 0.95rem;
        letter-spacing: 0.08em;
    }

    .cp-member-card .card-name {
        font-size: 0.9rem;
    }

    .cp-member-card .card-type {
        font-size: 0.65rem;
    }

    .cp-download-row {
        flex-direction: column;
        gap: 10px;
    }

    .cp-download-row a {
        width: 100%;
        justify-content: center;
    }

    .cp-sidebar {
        position: static;
        margin-bottom: 4px;
    }

    .cp-offer-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cp-otp-digit,
    .cp-otp-inputs input {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
}
