/* ============================================
   BMW M EDITION · ShopMill Design System
   Inspired by BMW M performance aesthetics
   ============================================ */

/* ========== FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800;900&display=swap');

/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ========== BACKGROUND ========== */
.bmw-bg {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #0a0a0f;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(56, 103, 214, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(214, 56, 120, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(120, 56, 214, 0.08) 0%, transparent 50%);
    overflow-x: hidden;
    position: relative;
}

/* ========== BMW M4 BACKGROUND OVERLAY ========== */
.bmw-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('bmw-m4-bg.jpg') center center / cover no-repeat;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

/* ========== PARTICLES BACKGROUND ========== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat linear infinite;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* ========== M STRIPES (BMW M inspired) ========== */
.m-stripes {
    display: flex;
    height: 4px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

.stripe {
    flex: 1;
    height: 100%;
}

.stripe.blue {
    background: #3867d6;
    animation: stripePulse 3s ease-in-out infinite;
}

.stripe.purple {
    background: #8854d0;
    animation: stripePulse 3s ease-in-out 0.3s infinite;
}

.stripe.red {
    background: #eb3b5a;
    animation: stripePulse 3s ease-in-out 0.6s infinite;
}

@keyframes stripePulse {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.5); }
}

/* ========== BMW CARD ========== */
.bmw-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    box-shadow:
        0 0 40px rgba(56, 103, 214, 0.1),
        0 0 80px rgba(56, 103, 214, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes cardReveal {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.bmw-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(56, 103, 214, 0.03) 60deg,
        transparent 120deg,
        rgba(235, 59, 90, 0.03) 180deg,
        transparent 240deg,
        rgba(136, 84, 208, 0.03) 300deg,
        transparent 360deg
    );
    animation: cardGlow 8s linear infinite;
    z-index: 0;
}

@keyframes cardGlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.card-inner {
    position: relative;
    z-index: 1;
    padding: 40px 32px 32px;
}

/* ========== BMW LOGO ========== */
.bmw-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.logo-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: logoSpin 10s linear infinite;
}

@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.logo-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(56, 103, 214, 0.3);
    animation: logoRingPulse 2s ease-in-out infinite;
}

@keyframes logoRingPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50%      { transform: scale(1.1); opacity: 0.6; }
}

.logo-center {
    font-size: 24px;
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(56, 103, 214, 0.5);
}

.logo-sub {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* ========== AUTH TABS ========== */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: rgba(56, 103, 214, 0.2);
    color: white;
    box-shadow: 0 2px 10px rgba(56, 103, 214, 0.15);
}

.auth-tab:active {
    transform: scale(0.95);
}

/* ========== AUTH FORMS ========== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: flex;
}

/* ========== TYPOGRAPHY ========== */
.bmw-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    text-align: center;
    letter-spacing: -0.5px;
}

.bmw-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin: 6px 0 28px;
    font-weight: 400;
}

/* ========== FORM ========== */
.bmw-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 4px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    width: 100%;
    padding: 14px 14px 14px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: white;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.input-wrap input:focus {
    border-color: rgba(56, 103, 214, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(56, 103, 214, 0.1);
}

.input-wrap input:focus ~ .input-glow {
    opacity: 1;
    transform: scale(1);
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    z-index: 2;
    opacity: 0.5;
}

.input-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0.95);
    border-radius: 14px;
    background: radial-gradient(ellipse at center, rgba(56, 103, 214, 0.1), transparent 70%);
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
}

.toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.4;
    padding: 4px;
    transition: opacity 0.2s;
}

.toggle-pass:hover {
    opacity: 0.8;
}

/* ========== CLOUDFLARE TURNSTILE ========== */
.cf-turnstile {
    margin: 8px 0 4px;
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.cf-turnstile iframe {
    border-radius: 8px !important;
}

/* ========== FORM OPTIONS ========== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-wrap input:checked + .checkmark {
    background: linear-gradient(135deg, #3867d6, #8854d0);
    border-color: transparent;
}

.checkbox-wrap input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.forgot-link {
    font-size: 13px;
    color: rgba(56, 103, 214, 0.7);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: rgba(56, 103, 214, 1);
}

/* ========== BMW BUTTON ========== */
.bmw-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3867d6, #8854d0);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(56, 103, 214, 0.3),
        0 0 40px rgba(56, 103, 214, 0.1);
}

.bmw-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0%   { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.bmw-btn:active {
    transform: scale(0.97);
}

.bmw-btn.loading .btn-text {
    opacity: 0;
}

.bmw-btn.loading .btn-loader {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%) scale(1);
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%) scale(0);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: all 0.3s ease;
}

.btn-loader .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: dotBounce 1s ease-in-out infinite;
}

.btn-loader .dot:nth-child(2) { animation-delay: 0.15s; }
.btn-loader .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ========== DIVIDER ========== */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 20px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.divider span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== SOCIAL BUTTONS ========== */
.social-login {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.social-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.08);
}

/* ========== SIGNUP PROMPT ========== */
.signup-prompt {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.signup-prompt a {
    color: rgba(56, 103, 214, 0.8);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.signup-prompt a:hover {
    color: rgba(56, 103, 214, 1);
}

/* ========== M BADGE ========== */
.m-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(56, 103, 214, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    color: rgba(56, 103, 214, 0.15);
    letter-spacing: -2px;
    z-index: 0;
}

/* ========== ORDER SUMMARY (PAY) ========== */
.order-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-count {
    font-weight: 700;
    color: rgba(56, 103, 214, 0.7);
}

.summary-items {
    max-height: 120px;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.summary-items::-webkit-scrollbar { display: none; }

.summary-empty {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    padding: 12px 0;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.summary-item-emoji {
    font-size: 22px;
}

.summary-item-info {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.summary-item-qty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-left: 4px;
}

.summary-item-price {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 800;
    color: white;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-amount {
    color: #3867d6;
}

/* ========== ROW 2 COL ========== */
.row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ========== PAYMENT METHODS ========== */
.payment-methods {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.pmethod {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.pmethod.active {
    border-color: rgba(56, 103, 214, 0.3);
    background: rgba(56, 103, 214, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.pmethod:active {
    transform: scale(0.95);
}

.pm-icon {
    font-size: 22px;
}

/* ========== SECURE BADGE ========== */
.secure-badge {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 20px;
    letter-spacing: 0.5px;
}

/* ========== SUCCESS OVERLAY ========== */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    text-align: center;
    animation: successPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes successPop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.success-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(56, 103, 214, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    position: relative;
    animation: successRing 2s ease-in-out infinite;
}

@keyframes successRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 103, 214, 0.3); }
    50%      { box-shadow: 0 0 0 20px rgba(56, 103, 214, 0); }
}

.success-check {
    font-size: 36px;
    color: #2ed573;
    font-weight: 900;
    animation: checkPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes checkPop {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.success-content h2 {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
}

.success-content p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 20px;
}

.back-btn {
    max-width: 200px;
    margin: 0 auto;
}

/* ========== CONFETTI BURST ========== */
.confetti-piece-burst {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: burstFall 2s ease-out forwards;
    pointer-events: none;
}

@keyframes burstFall {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0);
        opacity: 1;
    }
    20% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) rotate(180deg) scale(1);
    }
    100% {
        transform: translate(calc(var(--tx) * 2), calc(var(--ty) * 2 + 60vh)) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* ========== KEYFRAMES ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 420px) {
    .card-inner {
        padding: 32px 20px 24px;
    }

    .bmw-title {
        font-size: 24px;
    }

    .row-2col {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}