/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --brand-purple: #8b4a9a;
    --brand-orange: #f58220;
    --brand-bg: #f9fafb;
    --brand-purple-light: #e6c8e6;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* ============================================
   BASE & RESET
   ============================================ */
body {
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        sans-serif;
}

/* ============================================
   UTILITIES
   ============================================ */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.rounded-4xl {
    border-radius: 2rem !important;
}
.rounded-b-4xl {
    border-bottom-left-radius: 2rem !important;
    border-bottom-right-radius: 2rem !important;
}

.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

.fs-10 {
    font-size: 0.625rem !important;
}

.gap-1 {
    gap: 0.25rem !important;
}
.gap-2 {
    gap: 0.5rem !important;
}
.gap-3 {
    gap: 0.75rem !important;
}
.gap-4 {
    gap: 1rem !important;
}

/* ============================================
   BRAND COLORS
   ============================================ */
.bg-brand-green {
    background-color: var(--brand-purple) !important;
}
.bg-brand-purple {
    background-color: var(--brand-purple) !important;
}
.bg-brand-orange {
    background-color: var(--brand-orange) !important;
}
.text-brand-purple {
    color: var(--brand-purple) !important;
}
.bg-purple-brand {
    background-color: var(--brand-purple) !important;
}
.text-purple-brand {
    color: var(--brand-purple) !important;
}
.border-purple-brand {
    border-color: var(--brand-purple) !important;
}

.bg-gradient-header {
    background: linear-gradient(180deg, #e6c8e6 0%, #ffffff 100%);
}
.bg-gradient-card {
    background: linear-gradient(135deg, #ffffff 0%, #fdf7f5 100%);
}

.border-soft {
    border-color: #f3f4f6 !important;
}

/* ============================================
   APP CONTAINER (Mobile First)
   ============================================ */
.app-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Versi dengan padding untuk halaman form (login, register, edit profile) */
.app-container.form-page {
    border-radius: 24px;
    padding: 24px 20px;
    justify-content: center;
}

/* ============================================
   APP HEADER (Sticky)
   ============================================ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 64px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Untuk halaman form (login, register, edit profile) header tanpa sticky */
.form-page .app-header {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    height: auto;
    padding: 0;
    margin-bottom: 32px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
    text-align: center;
}

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #0f172a;
    font-size: 20px;
    transition: background 0.2s;
}
.back-btn:hover {
    background: #f0edef;
}

/* ============================================
   MAIN SCROLL AREA
   ============================================ */
.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.main-scroll::-webkit-scrollbar {
    display: none;
}
.main-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   FORMS (Login, Register, Edit Profile, Change Password)
   ============================================ */
.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 4px;
}

.form-control {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.15s;
}
.form-control:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.password-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Buttons */
.btn-primary-custom {
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    transition: background 0.2s;
}
.btn-primary-custom:hover {
    background: #1e293b;
    color: #fff;
}

.btn-outline-danger {
    border-radius: 12px;
    padding: 12px;
    font-weight: 500;
    border-color: #dc2626;
    color: #dc2626;
    background: transparent;
}
.btn-outline-danger:hover {
    background: #dc2626;
    color: #fff;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 14px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Social buttons */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    color: #0f172a;
    font-weight: 500;
    transition: background 0.2s;
    text-decoration: none;
    width: 100%;
}
.social-btn:hover {
    background: #f8fafc;
}

/* Text links */
.text-link {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}
.text-link:hover {
    text-decoration: underline;
}

/* ============================================
   MEMBER PILL
   ============================================ */
.member-pill {
    background-color: rgba(139, 74, 154, 0.2);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ============================================
   AVATAR UPLOAD (Edit Profile)
   ============================================ */
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}
.avatar-upload .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #64748b;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.avatar-upload .avatar:hover .overlay {
    opacity: 1;
}
.avatar-upload .avatar .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}
.avatar-upload .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-upload .avatar-label {
    margin-top: 8px;
    font-size: 14px;
    color: #64748b;
}

/* ============================================
   SUMMARY CARD (Riwayat Poin)
   ============================================ */
.summary-card {
    background: #502c9a;
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.summary-card .decor {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: radial-gradient(circle at 100% 0%, #fff 0%, transparent 50%);
    pointer-events: none;
}
.summary-card .label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #dae2fd;
    opacity: 0.9;
}
.summary-card .points {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}
.summary-card .points small {
    font-size: 16px;
    font-weight: 400;
    color: #dae2fd;
}

/* ============================================
   SECTION HEADING
   ============================================ */
.section-heading {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.section-heading h2 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

/* ============================================
   HISTORY ITEMS (Riwayat Poin)
   ============================================ */
.history-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
    cursor: default;
}
.history-item:hover {
    background: #f6f3f5;
}
.history-item .icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
.history-item .details {
    flex: 1;
    min-width: 0;
}
.history-item .details h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-item .details p {
    font-size: 14px;
    color: #45464d;
    margin: 0;
}
.history-item .point-info {
    text-align: right;
    flex-shrink: 0;
}
.history-item .point-info .amount {
    font-size: 16px;
    font-weight: 600;
    display: block;
}
.history-item .point-info .status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Status colors */
.text-success-green {
    color: #10b981;
}
.bg-success-soft {
    background: rgba(16, 185, 129, 0.1);
}
.text-warning-amber {
    color: #f59e0b;
}
.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
}
.text-error {
    color: #ba1a1a;
}
.bg-error-soft {
    background: rgba(186, 26, 26, 0.1);
}
.text-secondary-blue {
    color: #2170e4;
}
.bg-secondary-soft {
    background: rgba(33, 112, 228, 0.1);
}
.bg-purple-soft {
    background: rgba(139, 74, 154, 0.1);
}

/* ============================================
   QR WRAPPER
   ============================================ */
.qr-wrapper {
    background-color: #f3e8f5;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid #e9d5ed;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.qr-wrapper i {
    font-size: 2rem;
    color: var(--brand-purple);
}
.qr-wrapper .value-id-label {
    font-size: 0.625rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0;
}
.qr-wrapper .value-id {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-purple);
    letter-spacing: 0.1em;
}

/* ============================================
   VOUCHER ITEMS
   ============================================ */
.voucher-card {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.text-pink-600 {
    color: #db2777 !important;
}
.bg-orange-600 {
    background-color: #ea580c !important;
}
.min-h-140 {
    min-height: 140px;
}

.voucher-img-wrap {
    position: relative;
    width: 33.333%;
    min-width: 120px;
    max-width: 140px;
    flex-shrink: 0;
}
.voucher-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 140px;
}

.badge-digital {
    position: absolute;
    top: 0;
    left: 0;
    background: #4b5563;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-bottom-right-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-outlet {
    position: absolute;
    top: 0;
    left: 0;
    background: #ea580c;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-bottom-right-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.voucher-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 0.25rem 0.5rem;
    scroll-snap-type: x mandatory;
}
.voucher-scroll .voucher-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 100%;
}

/* ============================================
   LINE CLAMP
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   PROMO CAROUSEL
   ============================================ */
.promo-carousel {
    height: 13rem;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1e4a1e, #2d6b2d);
}
.promo-carousel .carousel-inner {
    height: 100%;
}
.promo-carousel .carousel-item {
    height: 100%;
    position: relative;
}
.promo-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
}
.promo-carousel .carousel-item .promo-overlay {
    position: absolute;
    inset: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.promo-carousel .carousel-item .promo-overlay .badge-placeholder {
    width: 4rem;
    height: 1rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}
.promo-carousel .carousel-item .promo-overlay .promo-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.3;
    max-width: 66%;
}
.promo-carousel .carousel-item .promo-overlay .promo-cta {
    margin-top: 0.75rem;
    background-color: var(--brand-orange);
    color: #fff;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    border: none;
    font-size: 0.75rem;
    width: max-content;
    transition: background-color 0.2s;
}
.promo-carousel .carousel-item .promo-overlay .promo-cta:hover {
    background-color: #d9731d;
}

.promo-carousel .carousel-indicators {
    bottom: 0.5rem;
    margin-bottom: 0;
    gap: 0.25rem;
}
.promo-carousel .carousel-indicators button {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    margin: 0;
    opacity: 1;
    transition: all 0.3s ease;
    text-indent: 0;
}
.promo-carousel .carousel-indicators button.active {
    width: 1rem;
    background: #fff;
}

.promo-carousel .carousel-control-prev,
.promo-carousel .carousel-control-next {
    width: 2rem;
    height: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}
.promo-carousel:hover .carousel-control-prev,
.promo-carousel:hover .carousel-control-next {
    opacity: 1;
}
.promo-carousel .carousel-control-prev {
    left: 0.5rem;
}
.promo-carousel .carousel-control-next {
    right: 0.5rem;
}
.promo-carousel .carousel-control-prev-icon,
.promo-carousel .carousel-control-next-icon {
    width: 0.75rem;
    height: 0.75rem;
}
.promo-carousel .carousel-item {
    transition: transform 0.6s ease-in-out;
}

/* ============================================
   BUNDLE IMAGE WRAP
   ============================================ */
.bundle-img-wrap {
    height: 10rem;
    overflow: hidden;
    position: relative;
}
.bundle-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   EXPIRY NOTICE
   ============================================ */
.bg-expiry {
    background-color: #b388b3;
}

/* ============================================
   ACTION LINKS (Riwayat Poin)
   ============================================ */
.action-link:first-child {
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}
.action-link:last-child {
    border-bottom-left-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}
.action-divider {
    border-bottom: 1px solid #f3f4f6;
}
