/* ============================================
   VIBESCASH - TikTok Design System (Light)
   ============================================ */

/* --- CSS Variables (TikTok palette - light mode like profile) --- */
:root {
    --color-primary: #FE2C55;
    --color-secondary: #25F4EE;
    --color-bg: #FFFFFF;
    --color-bg-elevated: #F8F8F8;
    --color-bg-card: #F1F1F2;
    --color-bg-input: #F1F1F2;
    --color-text-primary: #161823;
    --color-text-secondary: #75767B;
    --color-text-tertiary: #A0A0A5;
    --color-border: #E3E3E4;
    --color-success: #34C759;
    --color-warning: #FFD60A;
    --color-error: #FE2C55;
    --color-overlay: rgba(0, 0, 0, 0.5);

    --font-family: 'Proxima Nova', 'TikTokFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    --header-height: 56px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Typography --- */
.text-xs { font-size: 11px; line-height: 1.4; }
.text-sm { font-size: 13px; line-height: 1.4; }
.text-base { font-size: 15px; line-height: 1.5; }
.text-lg { font-size: 17px; line-height: 1.4; }
.text-xl { font-size: 20px; line-height: 1.3; }
.text-2xl { font-size: 24px; line-height: 1.2; }
.text-3xl { font-size: 32px; line-height: 1.1; }

.font-regular { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-primary-color { color: var(--color-primary); }
.text-secondary-color { color: var(--color-secondary); }

/* --- Layout --- */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.page-content {
    padding: var(--spacing-md);
    padding-top: calc(var(--header-height) + var(--spacing-md));
}

.app-container:not(:has(.app-header)) .page-content {
    padding-top: var(--spacing-md);
}

/* --- Header --- */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--header-height);
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}

.app-header__title {
    font-size: 18px;
    font-weight: 700;
}

.app-header__logo {
    display: flex;
    align-items: center;
    gap: 0;
    font-weight: 800;
    font-size: 20px;
}

.app-header__logo span:first-child {
    color: var(--color-text-primary);
}

.app-header__logo span:last-child {
    color: var(--color-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    line-height: 1;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

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

.btn-primary:hover {
    background-color: #E5284D;
}

.btn-secondary {
    background-color: var(--color-bg-input);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    background-color: #E3E3E4;
}

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background-color: var(--color-bg-elevated);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-rounded {
    border-radius: var(--radius-full);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* --- Inputs --- */
.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--color-bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.input::placeholder {
    color: var(--color-text-tertiary);
}

.input:focus {
    border-color: var(--color-text-secondary);
    background-color: var(--color-bg);
}

/* --- Cards --- */
.card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-elevated {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
}

/* --- Avatar --- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--color-bg-input);
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--color-primary);
    color: white;
}

.badge-success {
    background-color: var(--color-success);
    color: white;
}

/* --- Divider --- */
.divider {
    height: 1px;
    background-color: var(--color-border);
    margin: var(--spacing-md) 0;
}

/* --- List items --- */
.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.list-item:last-child {
    border-bottom: none;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - var(--spacing-md));
    min-height: calc(100dvh - var(--spacing-md));
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: var(--spacing-sm);
}

.login-logo__vibes {
    color: var(--color-text-primary);
}

.login-logo__cash {
    color: var(--color-primary);
}

.login-subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
}

.login-form {
    width: 100%;
    margin-bottom: var(--spacing-lg);
}

.login-input {
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 16px;
}

.login-input:focus {
    border-color: var(--color-text-primary);
    background-color: var(--color-bg);
}

.login-btn {
    margin-top: var(--spacing-sm);
    padding: 14px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.login-error {
    width: 100%;
    background-color: #FEE;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.login-field-error {
    display: block;
    font-size: 12px;
    color: var(--color-primary);
    margin-top: 4px;
    min-height: 16px;
}

.login-footer {
    text-align: center;
    margin-top: auto;
    padding-bottom: var(--spacing-lg);
}

/* ============================================
   TRANSFER PAGE (TikTok style)
   ============================================ */
.tf-section {
    margin-bottom: 4px;
}

.tf-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tf-label-muted {
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-weight: 400;
}

.tf-manage-link {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
}

.tf-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.tf-row-clickable {
    cursor: pointer;
    padding: 10px 0;
}

.tf-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tf-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.tf-value {
    font-size: 14px;
    color: var(--color-text-primary);
    font-weight: 500;
}

.tf-text-sm {
    font-size: 13px;
}

.tf-input-wrapper {
    margin: 4px 0 8px;
}

.tf-input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--color-text-primary);
    outline: none;
}

.tf-input::placeholder {
    color: var(--color-text-tertiary);
}

.tf-input:focus {
    border-color: var(--color-text-secondary);
}

.tf-amount-section {
    margin-top: 16px;
}

.tf-amount-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.tf-currency {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.tf-amount-input {
    flex: 1;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary);
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-family);
    padding: 0;
    min-width: 0;
}

.tf-all-btn {
    padding: 4px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: none;
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}

.tf-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 12px 0;
}

.tf-estimated {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    padding: 4px 0;
}

.tf-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--color-text-tertiary);
    font-size: 9px;
    color: var(--color-text-tertiary);
    font-style: normal;
    vertical-align: middle;
    margin-left: 2px;
}

.tf-terms {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin: 16px 0;
    line-height: 1.4;
}

.tf-terms em {
    color: var(--color-text-secondary);
    font-style: normal;
}

.tf-transfer-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.tf-transfer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tf-transfer-btn:not(:disabled):active {
    opacity: 0.85;
}

/* --- Loader overlay --- */
.tf-loader-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 16px;
}

.tf-loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-text-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.tf-loader-text {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* --- Success banner --- */
.tf-success-banner {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    max-width: 440px;
    width: calc(100% - 32px);
    padding: 10px 16px;
    background-color: #34C759;
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   TRANSFER DETAILS PAGE
   ============================================ */
.td-container {
    padding-top: 8px;
}

.td-subtitle {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-bottom: 4px;
}

.td-amount-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.td-currency {
    font-size: 16px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.td-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}

.td-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.td-detail-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.td-detail-value {
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: 500;
    text-align: right;
}

.td-status-complete {
    color: #34C759;
    font-weight: 600;
}

.td-help-link {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ============================================
   HOME - Transfer names button
   ============================================ */
.home-names-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background-color: var(--color-bg-input);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: background var(--transition-fast);
}

.home-names-btn:active {
    background-color: var(--color-border);
}

.home-names-btn-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.home-names-btn-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   TRANSFER NAMES TABLE
   ============================================ */
.tn-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
}

.tn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tn-table thead th {
    text-align: left;
    font-size: 11px;
    color: var(--color-text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    padding: 8px 4px;
    border-bottom: 1px solid var(--color-border);
}

.tn-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.tn-table tbody td {
    padding: 12px 4px;
    vertical-align: middle;
}

.tn-index {
    color: var(--color-text-tertiary);
    width: 30px;
}

.tn-username {
    font-weight: 500;
    color: var(--color-text-primary);
}

.tn-date {
    color: var(--color-text-secondary);
    font-size: 12px;
}

.tn-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.tn-copy-btn:active {
    background-color: var(--color-bg-input);
}

/* --- Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease forwards;
}

/* --- Scrollbar (hidden, TikTok style) --- */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
