/*!
 * Bootstrap 5.3+ Standalone Grid & Core Components for ARIGO PAY
 */
:root {
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --primary-light: #ebf5ff;
    --accent: #0ea5e9;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef9c3;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #e0f2fe;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* Grid */
.container, .container-fluid { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }
.row { display: flex; flex-wrap: wrap; margin-right: -12px; margin-left: -12px; }
.g-1 { margin-right: -4px; margin-left: -4px; } .g-1 > * { padding-right: 4px; padding-left: 4px; }
.g-2 { margin-right: -6px; margin-left: -6px; } .g-2 > * { padding-right: 6px; padding-left: 6px; }
.g-3 { margin-right: -8px; margin-left: -8px; } .g-3 > * { padding-right: 8px; padding-left: 8px; }
.g-4 { margin-right: -12px; margin-left: -12px; } .g-4 > * { padding-right: 12px; padding-left: 12px; }

[class*="col-"] { position: relative; width: 100%; padding-right: 12px; padding-left: 12px; box-sizing: border-box; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }

@media (min-width: 576px) {
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .d-lg-flex { display: flex !important; }
    .d-lg-none { display: none !important; }
}

/* Utilities */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Positioning */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-2\.5 { padding-left: 0.65rem !important; padding-right: 0.65rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

/* Typography */
.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-800 { font-weight: 800 !important; }
.text-muted { color: var(--text-muted, #94a3b8) !important; }
.text-secondary { color: var(--text-secondary, #64748b) !important; }
.text-primary { color: var(--primary, #1a56db) !important; }
.text-success { color: var(--success, #16a34a) !important; }
.text-danger { color: var(--danger, #dc2626) !important; }
.text-warning { color: var(--warning, #d97706) !important; }
.text-white { color: #ffffff !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-decoration-none { text-decoration: none !important; }
.small { font-size: 0.85rem !important; }
.fs-7 { font-size: 0.85rem !important; }
.fs-8 { font-size: 0.75rem !important; }
.font-monospace { font-family: monospace, SFMono-Regular, Consolas, Courier !important; }

/* Borders & Shadows */
.border { border: 1px solid var(--border, #e2e8f0) !important; }
.border-0 { border: none !important; }
.border-top { border-top: 1px solid var(--border, #e2e8f0) !important; }
.border-bottom { border-bottom: 1px solid var(--border, #e2e8f0) !important; }
.border-start-0 { border-left: none !important; }
.border-end-0 { border-right: none !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 999px !important; }
.rounded-3 { border-radius: 12px !important; }
.rounded-4 { border-radius: 16px !important; }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important; }
.shadow { box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important; }
.bg-light { background-color: var(--border-light, #f8fafc) !important; }
.bg-white { background-color: #ffffff !important; }
.bg-dark { background-color: #0f172a !important; }
.bg-opacity-50 { opacity: 0.85 !important; }

/* Forms */
.form-control, .form-select, .ap-input, .ap-select {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: var(--surface, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.form-control:focus, .form-select:focus, .ap-input:focus, .ap-select:focus {
    border-color: var(--primary, #1a56db);
    box-shadow: 0 0 0 3.5px rgba(26, 86, 219, 0.12);
}
.form-control-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.ap-form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.4rem;
    display: block;
}
.input-group { display: flex; align-items: stretch; width: 100%; position: relative; }
.input-group > .form-control, .input-group > .ap-input { flex: 1 1 auto; width: 1%; }
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    background-color: var(--border-light, #f8fafc);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px 0 0 10px;
}
.input-group > .border-start-0 { border-radius: 0 10px 10px 0; }
.input-group > input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Buttons */
.btn, .ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-primary, .ap-btn-primary { background-color: var(--primary, #1a56db); color: #ffffff; border-color: var(--primary, #1a56db); box-shadow: 0 4px 12px rgba(26,86,219,0.25); }
.btn-primary:hover, .ap-btn-primary:hover { background-color: var(--primary-dark, #1e429f); color: #ffffff; transform: translateY(-1px); }
.btn-sm, .ap-btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; border-radius: 8px; }
.btn-outline-secondary, .ap-btn-outline { color: var(--primary); border-color: var(--primary); background: transparent; }
.btn-outline-secondary:hover, .ap-btn-outline:hover { background: var(--primary); color: #ffffff; }
.btn-link { font-weight: 600; color: var(--primary); text-decoration: none; background: transparent; border: none; }
.ap-btn-full { width: 100%; }

/* Alerts */
.alert, .ap-alert {
    position: relative;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close { position: absolute; top: 50%; right: 1rem; transform: translateY(-50%); }
.alert-success, .ap-alert-success { color: #15803d; background-color: #dcfce7; border-color: #bbf7d0; }
.alert-danger, .ap-alert-danger { color: #b91c1c; background-color: #fee2e2; border-color: #fecaca; }
.alert-warning, .ap-alert-warning { color: #b45309; background-color: #fef3c7; border-color: #fde68a; }
.alert-info, .ap-alert-info { color: #0369a1; background-color: #e0f2fe; border-color: #bae6fd; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.65em;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 20px;
}
.bg-success-subtle { background-color: #dcfce7 !important; color: #15803d !important; }
.bg-warning-subtle { background-color: #fef3c7 !important; color: #b45309 !important; }
.bg-primary-subtle { background-color: #dbeafe !important; color: #1d4ed8 !important; }
.bg-danger-subtle { background-color: #fee2e2 !important; color: #b91c1c !important; }

/* Cards */
.ap-card, .card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.ap-card-body, .card-body { padding: 1.5rem; }
.ap-card-header, .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    background: transparent;
}
.ap-card-title, .card-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
}

/* Progress bar */
.ap-progress-bar, .progress {
    width: 100%;
    height: 8px;
    background: var(--border-light, #f1f5f9);
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0;
}
.ap-progress-fill, .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #1a56db) 0%, var(--accent, #0ea5e9) 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
