/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --bg-dark: #0a0a0c;
    --card-bg: rgba(22, 22, 26, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-white: #ffffff;
    --text-muted: #86868d;
    --accent-green: #76c043;
    --accent-teal: #1cbd9e;
    --tab-bg: #161619;
    --privat-green: #52b13c;
    
    /* Interactive states */
    --hover-bg: rgba(255, 255, 255, 0.05);
    --focus-border: #1cbd9e;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Fluid Moving Background Lights (Wow factor) */
.fluid-glows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    mix-blend-mode: screen;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.glow-1 {
    top: 10%;
    left: 20%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-teal) 0%, transparent 80%);
    animation: floatGlow1 22s ease-in-out infinite alternate;
}

.glow-2 {
    bottom: 15%;
    right: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-green) 0%, transparent 80%);
    animation: floatGlow2 26s ease-in-out infinite alternate;
}

.glow-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #52b13c 0%, transparent 80%);
    opacity: 0.15;
}

@keyframes floatGlow1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(100px, 80px, 0) scale(1.2); }
}

@keyframes floatGlow2 {
    0% { transform: translate3d(0, 0, 0) scale(1.1); }
    100% { transform: translate3d(-120px, -60px, 0) scale(0.9); }
}

/* Centered Layout Container */
.card-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

/* Premium Glassmorphic Card */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 420px;
    border-radius: 28px;
    border: 1px solid var(--card-border);
    padding: 40px 36px 36px 36px;
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 24px 70px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.auth-card:hover {
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.45),
        0 30px 80px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Title styling */
.card-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 26px;
    color: var(--text-white);
    letter-spacing: -0.6px;
    background: linear-gradient(135deg, #ffffff 0%, #a5a5a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tab Switcher */
.tab-switcher {
    position: relative;
    display: flex;
    background-color: var(--tab-bg);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 26px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    padding: 11px 0;
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.tab-btn.active {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.tab-slider {
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
}

.payment-method-fields {
    display: block;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-method-fields.hidden {
    display: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphic Credit Card Design (Wow factor) */
.virtual-card {
    position: relative;
    width: 100%;
    height: 180px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.virtual-card:hover {
    transform: translate3d(0, -4px, 0) rotateX(2deg) rotateY(-2deg);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

/* Glass card lights */
.card-glass-glow {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.18;
    pointer-events: none;
}

.glow-red {
    top: -30px;
    left: -30px;
    background: var(--accent-teal);
}

.glow-green {
    bottom: -30px;
    right: -30px;
    background: var(--accent-green);
}

.card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.card-chip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-chip {
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #fce68a 0%, #d97706 100%);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 46%, rgba(0,0,0,0.15) 46%, rgba(0,0,0,0.15) 54%, transparent 54%),
        linear-gradient(0deg, transparent 46%, rgba(0,0,0,0.15) 46%, rgba(0,0,0,0.15) 54%, transparent 54%);
    border-radius: 6px;
}

.card-contactless {
    color: rgba(255, 255, 255, 0.4);
}

.card-number-display {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
    color: #ffffff;
    margin: 14px 0;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-holder-display {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.card-expiry-display {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

.card-brand-logo {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 14px;
    font-weight: 700;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: -0.5px;
}

/* Card Inputs Layout */
.input-row-half {
    display: flex;
    gap: 16px;
}

.input-row-half .input-section {
    flex: 1;
}

/* Custom Bank selection Grid */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    margin-top: 10px;
}

.bank-item {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.bank-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateY(-3px);
}

.bank-logo-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.bank-item:hover .bank-logo-circle {
    transform: scale(1.1);
}

.bank-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    transition: color 0.2s ease;
}

/* Unique Bank Circle Logos */
.bank-logo-circle.mono {
    background-color: #151515;
    border: 1.5px solid #ff5b7f;
}
.bank-logo-circle.privat {
    background-color: #52b13c;
    color: #ffffff;
    font-size: 11px;
}
.bank-logo-circle.oshad {
    background-color: #00875a;
    color: #ffffff;
}
.bank-logo-circle.raif {
    background-color: #ffcc00;
    color: #000000;
    font-size: 13px;
}
.bank-logo-circle.pumb {
    background-color: #d12026;
    color: #ffffff;
}

/* Individual Bank Grid Active Borders */
.bank-item[data-bank="mono"].active {
    border-color: #ff5b7f;
    box-shadow: 0 0 12px rgba(255, 91, 127, 0.25);
    background-color: rgba(255, 91, 127, 0.05);
}
.bank-item[data-bank="mono"].active .bank-label { color: #ff5b7f; }

.bank-item[data-bank="privat"].active {
    border-color: #52b13c;
    box-shadow: 0 0 12px rgba(82, 177, 60, 0.25);
    background-color: rgba(82, 177, 60, 0.05);
}
.bank-item[data-bank="privat"].active .bank-label { color: #52b13c; }

.bank-item[data-bank="oshad"].active {
    border-color: #00875a;
    box-shadow: 0 0 12px rgba(0, 135, 90, 0.25);
    background-color: rgba(0, 135, 90, 0.05);
}
.bank-item[data-bank="oshad"].active .bank-label { color: #00875a; }

.bank-item[data-bank="raif"].active {
    border-color: #ffcc00;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.25);
    background-color: rgba(255, 204, 0, 0.05);
}
.bank-item[data-bank="raif"].active .bank-label { color: #ffcc00; }

.bank-item[data-bank="pumb"].active {
    border-color: #d12026;
    box-shadow: 0 0 12px rgba(209, 32, 38, 0.25);
    background-color: rgba(209, 32, 38, 0.05);
}
.bank-item[data-bank="pumb"].active .bank-label { color: #d12026; }

/* Input Fields Spacing */
.input-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 22px;
}

.input-label {
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    pointer-events: none;
    opacity: 0.85;
}

.phone-input-row {
    display: flex;
    align-items: center;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

.phone-input-row.focused {
    border-color: var(--focus-border);
}

/* Custom Country Select Dropdown */
.country-selector {
    position: relative;
}

.selected-country {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    user-select: none;
    transition: background-color 0.25s ease;
}

.selected-country:hover {
    background-color: var(--hover-bg);
}

.flag-icon {
    font-size: 18px;
    line-height: 1;
}

.country-code {
    color: var(--text-white);
    font-size: 17px;
    font-weight: 500;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.chevron-icon path {
    stroke: var(--text-muted);
}

.country-selector.open .chevron-icon {
    transform: rotate(180deg);
}

/* Dropdown Options */
.country-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: -8px;
    width: 250px;
    background-color: #121215;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.country-selector.open .country-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dropdown-search input {
    width: 100%;
    background-color: var(--tab-bg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: var(--text-white);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.dropdown-search input:focus {
    border-color: rgba(255, 255, 255, 0.15);
}

.country-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 6px 0;
}

/* Custom Scrollbar for Dropdown */
.country-list::-webkit-scrollbar {
    width: 5px;
}

.country-list::-webkit-scrollbar-track {
    background: transparent;
}

.country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.country-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.country-item:hover {
    background-color: var(--hover-bg);
}

.country-item.active {
    background-color: rgba(255, 255, 255, 0.06);
}

.country-item.hidden {
    display: none !important;
}

.country-item .flag {
    font-size: 17px;
}

.country-item .name {
    color: var(--text-white);
    font-size: 13px;
    font-weight: 500;
    flex-grow: 1;
}

.country-item .code {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Divider & Inputs */
.input-divider {
    width: 1px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 0 12px;
}

.phone-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-white);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.5px;
    width: 100%;
    caret-color: var(--accent-teal);
}

.phone-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.card-brand-icon {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

/* Pay Button styling with neon glow */
.submit-btn {
    display: block;
    width: 100%;
    padding: 15px 0;
    border-radius: 14px;
    border: none;
    outline: none;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-white);
    background: linear-gradient(90deg, #76c043 0%, #1cbd9e 100%);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(28, 189, 158, 0.25);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 
        0 12px 28px rgba(28, 189, 158, 0.35),
        0 4px 12px rgba(118, 192, 67, 0.2);
}

.submit-btn:active {
    transform: translate3d(0, 1px, 0);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.6s;
}

.submit-btn:hover::before {
    left: 100%;
}

/* CSS Shake and Spinner Animations */
@keyframes shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20%, 60% { transform: translate3d(-5px, 0, 0); }
    40%, 80% { transform: translate3d(5px, 0, 0); }
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Success Banner Notification */
.success-banner {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate3d(-50%, -120px, 0);
    background-color: #121215;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
    width: max-content;
    max-width: 90%;
}

.success-banner.show {
    transform: translate3d(-50%, 0, 0);
}

.success-banner .check-circle {
    background-color: var(--privat-green);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 24px 26px 24px;
        border-radius: 24px;
    }
    .card-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    .bank-grid {
        gap: 6px;
    }
    .bank-item {
        padding: 10px 4px;
    }
    .bank-logo-circle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Validation Error Styles */
.error-msg {
    color: #ff5b7f;
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    min-height: 15px;
    opacity: 0;
    transform: translate3d(0, -4px, 0);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.error-msg.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.phone-input-row.error {
    border-color: #ff5b7f !important;
    box-shadow: 0 0 0 3px rgba(255, 91, 127, 0.15) !important;
}

/* Bank Specific Dynamic Form Container & Custom Elements */
#bank-custom-form-container {
    margin-top: 20px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bank-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.03);
}

.mono-logo-header, .privat-logo-header, .oshad-logo-header, .raif-logo-header, .pumb-logo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mono-cat { font-size: 20px; }
.mono-title { font-weight: 700; color: #ff5b7f; }
.mono-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.mono-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mono-qr-placeholder {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 14px;
    border: 1.5px dashed rgba(255, 91, 127, 0.3);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.mono-qr-timer {
    font-size: 11px;
    color: var(--text-muted);
}
.mono-qr-timer span {
    color: #ff5b7f;
    font-weight: 600;
}

.privat-badge {
    background-color: #52b13c;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
}
.privat-title { font-weight: 700; color: #52b13c; }

.oshad-badge {
    background-color: #00875a;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
}
.oshad-title { font-weight: 700; color: #00875a; }

.raif-badge {
    background-color: #ffcc00;
    color: #000000;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
}
.raif-title { font-weight: 700; color: #ffcc00; }

.pumb-badge {
    background-color: #d12026;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
}
.pumb-title { font-weight: 700; color: #d12026; }

/* Global helper classes */
.hidden {
    display: none !important;
}
