/**
 * App-wide: typography rhythm, page width, toast notifications, form surfaces.
 * Load after style-backend.css / style-shell-fintech.css
 */

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 120rem) {
    html {
        font-size: 106.25%;
    }
}

/* Max ~7xl container — consistent width across user pages */
.ft-page-container {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1rem, 3vw, 1.75rem);
    padding-right: clamp(1rem, 3vw, 1.75rem);
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.ft-page-head {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.ft-page-title {
    margin: 0;
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.ft-page-lead {
    margin: 0.35rem 0 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
}

/* Card surfaces (match dashboard wallet aesthetic) */
.ft-card-surface {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 1rem;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.06);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.ft-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

/* Legacy hero title spacing when used inside ft-page */
body.ft-user-shell .dashboard_hero {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    margin-bottom: 1rem;
    color: #0f172a;
}

/* ---------- Toast / snackbar (replaces full-width header bars) ---------- */
#floatingError,
#floatingSuccess {
    position: fixed !important;
    z-index: 100000 !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) translateY(150%) !important;
    width: auto !important;
    min-width: min(18rem, calc(100vw - 2rem)) !important;
    max-width: min(28rem, calc(100vw - 2rem)) !important;
    margin: 0 !important;
    padding: 0.875rem 1.125rem 0.875rem 0.875rem !important;
    border-radius: 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
    font-weight: 500 !important;
    text-align: left !important;
    display: none !important;
    align-items: flex-start !important;
    gap: 0.625rem !important;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.08),
        0 20px 40px -12px rgba(15, 23, 42, 0.18) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.25s ease !important;
}

#floatingError.show,
#floatingSuccess.show {
    display: flex !important;
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#floatingSuccess {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

#floatingSuccess::before {
    content: "" !important;
    flex-shrink: 0 !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-top: 0.1rem !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E")
        center / contain no-repeat !important;
}

#floatingError {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

#floatingError::before {
    content: "" !important;
    flex-shrink: 0 !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-top: 0.1rem !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E")
        center / contain no-repeat !important;
}

@media (min-width: 48rem) {
    #floatingError,
    #floatingSuccess {
        left: auto !important;
        right: 1.5rem !important;
        bottom: 1.5rem !important;
        transform: translateX(0) translateY(150%) !important;
    }

    #floatingError.show,
    #floatingSuccess.show {
        transform: translateX(0) translateY(0) !important;
    }
}

/* Table horizontal scroll helper (beneficiary, wallet, etc.) */
.ft-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    background: #fff;
}

.ft-table-scroll table {
    margin-bottom: 0;
    min-width: 52rem;
}

/* KYC dropzones */
.ft-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 1.25rem 1rem;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
    cursor: pointer;
    min-height: 8.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ft-dropzone:hover,
.ft-dropzone.ft-dropzone--focus {
    border-color: #4f46e5;
    background: #eef2ff;
}

.ft-dropzone:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
}

.ft-dropzone.ft-dropzone--drag {
    border-color: #4f46e5;
    background: #e0e7ff;
}

.ft-dropzone-input {
    position: absolute !important;
    width: 0.1rem !important;
    height: 0.1rem !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

.ft-dropzone-face {
    pointer-events: none;
}

.ft-dropzone-face svg {
    width: 2rem;
    height: 2rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.ft-dropzone-face p {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
}

.ft-dropzone-hint {
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.ft-dropzone-name {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #4f46e5;
    font-weight: 600;
    word-break: break-all;
}

.ft-kyc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .ft-kyc-grid {
        grid-template-columns: 1fr;
    }
}

/* Primary actions on forms */
.dashboard_div_button,
.table_options_button {
    min-height: 2.75rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.625rem;
}

@media (max-width: 40rem) {
    .dashboard_div_button,
    .table_options_button {
        width: 100%;
    }

    .table_options {
        flex-direction: column;
        align-items: stretch !important;
    }
}

