/* Community Billing Styles - Matching Journey Design */
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #0f1a2a;
    --muted: #6b7280;
    --line: #e5e7eb;
    --navy: #0f2f4a;
    --accent: #ff2e7a; /* price & CTA */
    --accent-600: #e4286d;
    --focus: #2c8ea5;
    --radius: 14px;
    --shadow: 0 10px 24px rgba(15,47,74,.10), 0 2px 6px rgba(15,47,74,.06);
    
    /* Legacy variables for backward compatibility */
    --main-color: #1D88FC;
    --font-primary: 'Roboto';
    --button-corners: 3px;
}

body.community-billing {
    font-family: var(--font-primary);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

/* Grid Layout - Journey Style */
.grid { 
    display: grid; 
    grid-template-columns: 3fr 1fr; 
    gap: 28px; 
}

/* Cards - Journey Style */
.card { 
    background: var(--card); 
    border: 1px solid var(--line); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
}

.billing-card { 
    padding: 28px; 
}

.billing-card h2 { 
    margin: 0 0 18px; 
    font-size: 18px; 
}

/* Legacy containers for compatibility */
.billing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 28px;
}

.billing-main {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.billing-sidebar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    height: fit-content;
}

/* Two-column rail inside the billing card - Journey Style */
.rail { 
    display: grid; 
    grid-template-columns: 2fr 3fr; 
    gap: 20px; 
    align-items: start; 
}

.rail .aside { 
    font-size: 15px; 
    color: #000; 
    line-height: 1.5; 
}

.rail .aside strong {
    color: #262626;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: -1.34px;
    display: block; 
    margin-bottom: 8px;
}

.fields { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 16px; 
}

.field { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
}

label {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px; 
    color: #374151; 
}

input[type="text"], input[type="tel"], input[type="number"], select {
    height: 44px; 
    border: 1px solid var(--line); 
    border-radius: 10px; 
    padding: 0 14px; 
    background: #fff; 
    outline: none; 
    font-size: 14px; 
    color: #111827;
    transition: border .2s, box-shadow .2s;
}

input::placeholder { 
    color: #9aa3b2; 
}

input:focus, select:focus {
    border-color: var(--focus); 
    box-shadow: 0 0 0 3px rgba(44,142,165,.18);
}

/* Inline 2 cols - Journey Style */
.two { 
    display: grid; 
    grid-template-columns: 1fr 160px; 
    gap: 12px; 
}

.two .small { 
    max-width: 160px; 
}

.row { 
    display: grid; 
    grid-template-columns: repeat(2, minmax(0,1fr)); 
    gap: 12px; 
}

/* Legacy form styles for compatibility */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border .2s, box-shadow .2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(44,142,165,.18);
}

.card-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.card-brand-icon {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.card-brand-icon.visa {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iIzAwNTFBNSIvPgo8L3N2Zz4=');
}

.card-brand-icon.mastercard {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0VCMDAxQiIvPgo8L3N2Zz4=');
}

.card-number-input {
    padding-left: 40px !important;
    padding-right: 80px !important;
}

.card-update-btn {
    position: absolute;
    right: 10px;
    background: var(--main-color);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
}

.card-update-btn:hover {
    opacity: 0.9;
}

/* Plan / summary card - Journey Style */
.plan-card { 
    padding: 24px; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    text-align: center;
}


.plan-card .title { 
    font-weight: 700; 
    color: #111827; 
    font-size: 18px;
}

.plan-card .desc { 
    color: #000; 
    line-height: 1.5; 
}

.price { 
    font-size: 42px; 
    font-weight: 800; 
    color: var(--main-color); 
    line-height: 1; 
}

.per { 
    color: #111827; 
    margin-top: -6px; 
}

.plan-links { 
    font-size: 13px; 
    display: flex; 
    gap: 12px; 
    color: #64748b; 
    align-self: center;
}

.plan-links a { 
    color: #0f2f4a; 
    text-decoration: none; 
}

.plan-links a:hover { 
    text-decoration: underline; 
}

/* Legacy plan styles for compatibility */
.plan-info {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
}

.plan-info h3 {
    margin: 0 0 1rem 0;
    color: var(--navy);
    font-weight: 700;
}

.plan-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.plan-detail:last-child {
    margin-bottom: 0;
}

.plan-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.plan-status.active {
    background: #d4edda;
    color: #155724;
}

.plan-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.plan-status.completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* Payment Dates Section - Following project specifications */
.payment-dates {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid var(--main-color);
}

.payment-dates h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 0.9rem;
}

.date-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.date-item:last-child {
    margin-bottom: 0;
}

/* Actions - Journey Style */
.actions { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
    margin-top: 6px; 
}

.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 12px 18px; 
    border-radius: 12px; 
    font-weight: 600; 
    text-decoration: none; 
    border: 0; 
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary { 
    background: var(--main-color); 
    color: #fff; 
}

.btn-primary:hover { 
    background: var(--main-color); 
}

.btn-link { 
    background: transparent; 
    color: var(--muted); 
}

.btn-link:hover { 
    color: #374151; 
    text-decoration: underline; 
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Legacy action buttons */
.action-buttons {
    display: flex;
    gap: 14px;
    margin-top: 6px;
}

/* Loading State - Journey Style */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* Inline button spinner for Save Card */
.btn.btn-primary.is-loading {
  opacity: 0.9;
  pointer-events: none;
}
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: btnspin .8s linear infinite;
}
@keyframes btnspin {
  to { transform: rotate(360deg); }
}

.loading-overlay::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--line);
    border-top: 3px solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles - Journey Style */
.modal {
    position: fixed;

    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

#membersModal .modal-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease-out;
    margin: 0 auto;
    position: absolute;
    left: 50% !important;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#membersModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--navy);
}

/* Status Messages - Journey Style */
.success-message, .error-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
    border: 1px solid;
}

.success-message {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Payment History Table - Journey Style */
.payment-history-table {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.payment-history-table th {
    background: var(--bg);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--navy);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
}

.payment-history-table td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.payment-history-table tr:last-child td {
    border-bottom: none;
}

.payment-history-table tr:hover {
    background: rgba(15,47,74,0.02);
}

/* Divider - Journey Style */
.divider { 
    height: 1px; 
    background: var(--line); 
    margin: 2px 0 10px; 
}

/* Payment History Modal - Journey Style */
.payment-modal {
    position: fixed !important;
    z-index: 10000 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
}

.payment-modal[style*="flex"] {
    display: flex !important;
}

.payment-modal-content {
    background-color: var(--card);
    margin: 5% auto;
    border-radius: var(--radius);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow), 0 20px 40px rgba(15,47,74,.15);
    animation: modalSlideIn 0.3s ease-out;
}

.payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, var(--bg) 0%, #fff 100%);
}

.payment-modal-header h3 {
    margin: 0;
    color: var(--navy);
    font-size: 20px;
    font-weight: 700;
}

.payment-modal-close {
    color: var(--muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.payment-modal-close:hover {
    color: var(--navy);
}

.payment-modal-body {
    padding: 28px;
    max-height: 60vh;
    overflow-y: auto;
}

.cancel-warning {
    background: #fff9f0;
    border: 1px solid #ffe8cc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: var(--text);
    margin-bottom: 24px;
    box-shadow: inset 0 0 0 1px rgba(255, 153, 0, 0.08);
}

.cancel-warning h4 {
    margin: 8px 0 12px;
    color: #d97706;
    font-size: 18px;
    font-weight: 700;
}

.cancel-warning p {
    margin-bottom: 12px;
    color: var(--muted);
}

.cancel-warning ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    color: var(--muted);
}

.cancel-warning li {
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
    line-height: 1.45;
}

.cancel-warning li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: #f97316;
}

.warning-icon {
    font-size: 32px;
    line-height: 1;
}

.current-plan-info {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    text-align: left;
    color: var(--text);
}

.current-plan-info strong {
    color: var(--navy);
    font-weight: 600;
}

.cancel-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.cancel-actions .btn {
    min-width: 220px;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cancel-actions .btn-primary {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: #fff;
}

.cancel-actions .btn-primary:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 53, 69, 0.2);
}

.cancel-actions .btn-link {
    background: transparent;
    color: var(--main-color);
    border: none;
    text-decoration: underline;
    padding: 0;
}

.cancel-actions .btn-link:hover {
    color: var(--accent-600);
}

.cancel-processing {
    text-align: center;
    padding: 24px;
    border-radius: 12px;
    background: #f3f4f6;
    color: var(--muted);
}


.cancel-actions .btn.is-busy {
    cursor: wait;
    opacity: 0.7;
}
.cancel-processing .loading-spinner {
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .cancel-actions {
        width: 100%;
    }

    .cancel-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Payment Statistics - Journey Style */
.payment-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--line);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
}

/* Legacy payment stats */
.payment-stat-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--line);
}

.payment-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--main-color);
}

.payment-stat-label {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* Responsive Design - Journey Style */
@media (max-width: 980px) {
    .grid { 
        grid-template-columns: 1fr; 
    }
    .plan-card { 
        order: 2; 
    }
    .rail { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 768px) {
    .billing-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .payment-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }

    .payment-history-table {
        overflow-x: auto;
    }

    .payment-history-table table {
        min-width: 600px;
    }
}

/* Badge Styles for Payment History */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #155724;
    background-color: #d4edda;
}

.badge-warning {
    color: #856404;
    background-color: #fff3cd;
}

.badge-secondary {
    color: #6c757d;
    background-color: #e2e3e5;
}

.badge-danger {
    color: #721c24;
    background-color: #f8d7da;
}

.badge-dark {
    color: #1b1e21;
    background-color: #d6d8db;
}

.badge-primary {
    color: #004085;
    background-color: #b3d4fc;
}

.badge-info {
    color: #0c5460;
    background-color: #d1ecf1;
}

/* Button Styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--bg);
    border-color: var(--main-color);
}

/* Payment History Table Enhancements */
.payment-badges {
    margin-top: 0.25rem;
}

.payment-badges .badge {
    margin-right: 0.5rem;
}

.payment-date {
    font-weight: 600;
    color: #333;
}

.payment-id {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.payment-description {
    font-weight: 500;
    color: #333;
}

/* Invoice Modal Specific Styles */
#invoiceModal .payment-modal-content {
    max-width: 800px;
}

.invoice-frame-container {
    width: 100%;
    height: 500px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.invoice-frame-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Invoice Modal */
@media (max-width: 768px) {
    #invoiceModal .payment-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .invoice-frame-container {
        height: 400px;
    }
}

.card-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: border 0.2s, box-shadow 0.2s;
    height: 44px;
}

.card-input-wrapper:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(44,142,165,.18);
}

.card-input-wrapper.error {
    border-color: #dc3545;
}

.card-input-wrapper.error:focus-within {
    box-shadow: 0 0 0 3px rgba(220,53,69,.18);
}

.card-number-input {
    flex: 1;
    height: 42px;
    border: none;
    outline: none;
    padding: 0 14px 0 40px;
    background: transparent;
    font-size: 14px;
    color: #111827;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.card-number-input::placeholder {
    color: #9aa3b2;
    font-family: inherit;
}

.card-brand-icon {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 2;
}

.card-brand-icon.active {
    opacity: 1;
}

.card-brand-icon.generic {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0U1RTdFQiIvPgo8L3N2Zz4=');
}

.card-brand-icon.visa {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iIzAwNUY4RiIvPgo8L3N2Zz4=');
}

.card-brand-icon.mastercard {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0VCMDAxQiIvPgo8L3N2Zz4=');
}

.card-brand-icon.amex {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iIzAwN0NDQyIvPgo8L3N2Zz4=');
}

.card-brand-icon.discover {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA0MCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjI0IiByeD0iNCIgZmlsbD0iI0ZGN0YwMCIvPgo8L3N2Zz4=');
}

.card-update-btn {
    position: absolute;
    right: 8px;
    background: var(--main-color);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
    height: 28px;
}

.card-update-btn:hover {
    background: var(--main-color);
    color: white;
}

.card-input-helper {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-security-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-security-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

/* Card Update Modal */
.card-update-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
}

.card-update-modal-content {
    background-color: var(--card);
    margin: 10% auto;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow), 0 20px 40px rgba(15,47,74,.15);
    animation: modalSlideIn 0.3s ease-out;
}

.card-update-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--line);
}

.card-update-modal-header h3 {
    margin: 0;
    color: var(--navy);
    font-size: 18px;
    font-weight: 700;
}

.card-update-modal-close {
    color: var(--muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.card-update-modal-close:hover {
    color: var(--navy);
}

.card-update-modal-body {
    padding: 28px;
}

.card-form-group {
    margin-bottom: 20px;
}

.card-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.card-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.card-expiry-input, .card-cvc-input {
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    background: #fff;
    outline: none;
    font-size: 14px;
    color: #111827;
    transition: border 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.card-expiry-input:focus, .card-cvc-input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(44,142,165,.18);
}

.card-expiry-input::placeholder, .card-cvc-input::placeholder {
    color: #9aa3b2;
}

.card-expiry-input.error, .card-cvc-input.error {
    border-color: #dc3545;
}

.card-expiry-input.error:focus, .card-cvc-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220,53,69,.18);
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.card-actions .btn {
    flex: 1;
}

@media (max-width: 480px) {
    .card-update-modal-content {
        margin: 20px 10px;
        width: calc(100% - 20px);
    }
    
    .card-form-row {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-direction: column;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
