/**
 * Flutur Rewards - Frontend Styles
 * Brand palette: Mauve Wing #B8879A, Chrysalis Cream #F5ECE0, Velvet Plum #3E2438
 */

.fr-account-wrap {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #3E2438;
    max-width: 800px;
}

.fr-account-wrap h3 {
    font-family: 'Bodoni FLF', Georgia, serif;
    font-style: italic;
    color: #3E2438;
    margin: 2em 0 1em;
    font-size: 1.6em;
}

/* Balance Card */
.fr-balance-card {
    background: linear-gradient(135deg, #F5ECE0 0%, #ffffff 100%);
    border: 1px solid #B8879A;
    border-radius: 16px;
    padding: 2.5em 2em;
    text-align: center;
    margin-bottom: 2em;
    box-shadow: 0 4px 20px rgba(184, 135, 154, 0.15);
}

.fr-balance-icon {
    font-size: 3em;
    margin-bottom: 0.2em;
}

.fr-balance-number {
    font-family: 'Bodoni FLF', Georgia, serif;
    font-style: italic;
    font-size: 3.5em;
    color: #3E2438;
    line-height: 1;
    margin-bottom: 0.2em;
}

.fr-balance-label {
    font-size: 0.95em;
    color: #B8879A;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1em;
}

.fr-balance-value {
    font-size: 1.2em;
    color: #3E2438;
    font-weight: 500;
    margin-bottom: 1.5em;
}

.fr-balance-lifetime {
    font-size: 0.9em;
    color: #666;
    padding-top: 1em;
    border-top: 1px dashed #B8879A;
}

/* Redemption Tiers */
.fr-section-intro {
    color: #666;
    margin-bottom: 1.5em;
}

.fr-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1em;
    margin-bottom: 2em;
}

.fr-tier-card {
    background: #fff;
    border: 2px solid #F5ECE0;
    border-radius: 12px;
    padding: 1.5em 1em;
    text-align: center;
    transition: all 0.2s ease;
}

.fr-tier-card.available {
    border-color: #B8879A;
}

.fr-tier-card.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 135, 154, 0.2);
}

.fr-tier-card.locked {
    opacity: 0.6;
    background: #fafafa;
}

.fr-tier-points {
    font-size: 1.3em;
    font-weight: 600;
    color: #3E2438;
    margin-bottom: 0.3em;
}

.fr-tier-value {
    font-family: 'Bodoni FLF', Georgia, serif;
    font-style: italic;
    font-size: 1.5em;
    color: #B8879A;
    margin-bottom: 1em;
}

.fr-redeem-btn {
    background: #3E2438 !important;
    color: #fff !important;
    border: none !important;
    padding: 0.7em 1.5em !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    width: 100%;
}

.fr-redeem-btn:hover {
    background: #B8879A !important;
}

.fr-tier-locked {
    font-size: 0.85em;
    color: #999;
    line-height: 1.4;
}

/* Result message */
#fr-redemption-result {
    padding: 1.2em;
    border-radius: 8px;
    margin-bottom: 1.5em;
    font-weight: 500;
}

#fr-redemption-result.success {
    background: #f0f9f0;
    border: 1px solid #4caf50;
    color: #1b5e20;
    display: block !important;
}

#fr-redemption-result.error {
    background: #fdf2f2;
    border: 1px solid #e57373;
    color: #b71c1c;
    display: block !important;
}

#fr-redemption-result code {
    background: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 1px;
    color: #3E2438;
    display: inline-block;
    margin: 0 4px;
}

/* Ways to earn */
.fr-earn-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fr-earn-list li {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 1em 0;
    border-bottom: 1px solid #F5ECE0;
}

.fr-earn-list li:last-child {
    border-bottom: none;
}

.fr-earn-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

.fr-earn-text {
    line-height: 1.5;
}

.fr-earn-text em {
    color: #B8879A;
    font-size: 0.85em;
}

/* History table */
.fr-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.fr-history-table th,
.fr-history-table td {
    padding: 0.8em 0.6em;
    text-align: left;
    border-bottom: 1px solid #F5ECE0;
}

.fr-history-table th {
    background: #F5ECE0;
    font-weight: 600;
    color: #3E2438;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fr-history-table .fr-points-col {
    text-align: right;
    font-weight: 600;
}

.fr-history-table .fr-points-col.positive {
    color: #2e7d32;
}

.fr-history-table .fr-points-col.negative {
    color: #c62828;
}

/* Product preview integrated from Flutur Rewards Product Preview. */
.flutur-product-rewards {
    font-family: 'Poppins', sans-serif;
    display: inline-flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #ffdef4 0%, #fff5fa 100%);
    border: 1px solid rgba(235, 81, 183, .2); border-radius: 100px;
    padding: 10px 18px; margin: 16px 0; position: relative; box-sizing: border-box;
    max-width: 100%; transition: border-color .3s ease, box-shadow .3s ease;
}
.flutur-product-rewards:hover {
    border-color: rgba(235, 81, 183, .4);
    box-shadow: 0 8px 20px -8px rgba(235, 81, 183, .2);
}
.flutur-product-rewards-icon {
    font-size: 22px; line-height: 1; flex-shrink: 0;
    animation: fr-product-flutter 4s ease-in-out infinite;
}
@keyframes fr-product-flutter {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.1) rotate(2deg); }
}
.flutur-product-rewards-text { font-size: 14px; color: #232323; font-weight: 500; }
.flutur-product-rewards-text strong { color: #eb51b7; font-weight: 700; }
.flutur-product-rewards-info { flex-shrink: 0; margin: 0; padding: 0; border: 0; }
.flutur-product-rewards .flutur-info-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; padding: 0; cursor: pointer; list-style: none;
    background: rgba(235, 81, 183, .15); border: 1px solid rgba(235, 81, 183, .3);
    border-radius: 50%; font-size: 11px; font-weight: 700; color: #eb51b7;
}
.flutur-info-icon::-webkit-details-marker { display: none; }
.flutur-product-rewards-info[open] .flutur-info-icon,
.flutur-info-icon:hover { background: #eb51b7; color: #fff; }
.flutur-info-icon:focus-visible { outline: 2px solid #232323; outline-offset: 4px; }
.flutur-product-rewards .flutur-tooltip {
    position: absolute; bottom: calc(100% + 12px); right: 0;
    background: #232323; color: #fff; padding: 16px 18px; border-radius: 14px;
    width: 260px; max-width: min(100%, calc(100vw - 32px)); box-sizing: border-box;
    font-size: 13px; line-height: 1.5; z-index: 100;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .3);
}
.flutur-tooltip::after {
    content: ''; position: absolute; top: 100%; right: 18px;
    border: 8px solid transparent; border-top-color: #232323;
}
.flutur-tooltip strong {
    display: block; font-size: 13px; color: #eb51b7; margin-bottom: 6px;
    font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.flutur-tooltip p { margin: 0 0 10px; opacity: .9; }
.flutur-tooltip-link { color: #ffdef4 !important; font-size: 12px; font-weight: 600; text-decoration: underline; }
.flutur-tooltip-link:hover { color: #fff !important; }
@media (max-width: 640px) {
    .flutur-product-rewards { display: flex; width: 100%; padding: 12px 16px; }
    .flutur-product-rewards-text { flex: 1; min-width: 0; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .flutur-product-rewards-icon { animation: none; }
    .flutur-product-rewards { transition: none; }
}

/* Cart total row */
.fr-cart-earn th,
.fr-cart-earn td {
    color: #B8879A;
    font-size: 0.95em;
}

/* Loading state */
.fr-redeem-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .fr-balance-number {
        font-size: 2.8em;
    }
    .fr-tiers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
