.tpas-portal {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header with Avatar */
.tpas-portal-header {
    margin-bottom: 0;
    padding: 25px 30px;
    background: linear-gradient(135deg, #8b0000, #5a0000);
    border-radius: 12px 12px 0 0;
    color: #fff;
}
.tpas-portal-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}
.tpas-portal-avatar img, .tpas-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
}
.tpas-avatar-placeholder {
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}
.tpas-avatar-large { width: 100px; height: 100px; font-size: 36px; }
.tpas-portal-header h2 { color: #fff; margin: 0 0 6px; font-size: 22px; }
.tpas-membership-badge {
    background: rgba(255,255,255,0.15);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}
.tpas-membership-badge strong { color: #fff; }

/* Tabs */
.tpas-portal-tabs {
    display: flex;
    background: #f8f8f8;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    overflow-x: auto;
}
.tpas-tab {
    padding: 14px 22px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.tpas-tab:hover { color: #8b0000; background: rgba(139,0,0,0.04); }
.tpas-tab.active { color: #8b0000; border-bottom-color: #8b0000; background: #fff; }

/* Content */
.tpas-portal-content {
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 25px;
}

/* Grid */
.tpas-portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.tpas-portal-card {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 22px;
}
.tpas-portal-card h3 {
    color: #8b0000;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}
.tpas-portal-card-wide { grid-column: 1 / -1; }

/* Info Table */
.tpas-info-table { width: 100%; border-collapse: collapse; }
.tpas-info-table td { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.tpas-info-table td:first-child { color: #666; width: 40%; }
.tpas-info-table tr:last-child td { border-bottom: none; }

.tpas-status-active {
    color: #0a7c00;
    font-weight: 600;
    background: #e8f5e9;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* Quick Actions */
.tpas-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tpas-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}
.tpas-action-btn:hover { border-color: #8b0000; color: #8b0000; }
.tpas-action-icon { font-size: 20px; }

/* Membership Card Preview */
.tpas-card-preview-centered { display: flex; justify-content: center; }
.tpas-card {
    background: #fff;
    border-radius: 16px;
    color: #333;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 2px solid #8b0000;
    width: 380px;
    text-align: left;
}
.tpas-card-large { width: 420px; }
.tpas-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid #8b0000; }
.tpas-card-header img { height: 50px; width: auto; }
.tpas-card-header h2 { margin: 0; font-size: 15px; font-weight: 700; color: #8b0000; }
.tpas-card-body { margin-bottom: 15px; }
.tpas-card-photo { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #8b0000; margin-bottom: 12px; }
.tpas-card-name { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: #222; }
.tpas-card-id { font-size: 14px; color: #8b0000; font-weight: 600; margin-bottom: 3px; }
.tpas-card-since { font-size: 13px; color: #666; }
.tpas-card-footer { display: flex; justify-content: flex-end; }
.tpas-card-qr img { border-radius: 6px; border: 1px solid #eee; padding: 4px; }

/* Wallet Buttons */
.tpas-wallet-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tpas-wallet-btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s;
    color: #fff;
}
.tpas-wallet-btn:hover { opacity: 0.85; color: #fff; }
.tpas-google-wallet { background: #1a73e8; }
.tpas-apple-wallet { background: #000; }

/* Forms */
.tpas-form { max-width: 100%; }
.tpas-form-row { margin-bottom: 14px; }
.tpas-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 13px;
}
.tpas-form-row input[type="text"],
.tpas-form-row input[type="email"],
.tpas-form-row input[type="tel"],
.tpas-form-row input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.tpas-form-row input:focus { border-color: #8b0000; outline: none; }
.tpas-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }

.tpas-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.tpas-btn:hover { opacity: 0.85; }
.tpas-btn-primary { background: #8b0000; color: #fff; }
.tpas-btn-secondary { background: #eee; color: #333; }
.tpas-btn-danger { background: #c62828; color: #fff; }

.tpas-form-message { font-size: 13px; }
.tpas-form-message.success { color: #0a7c00; }
.tpas-form-message.error { color: #c00; }

.tpas-help-text { font-size: 12px; color: #999; margin-top: 5px; }

/* Photo section */
.tpas-photo-section { text-align: center; }
.tpas-photo-preview { margin-bottom: 15px; }
.tpas-photo-preview img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid #eee; }

/* Security tips */
.tpas-security-tips { padding-left: 18px; color: #555; font-size: 14px; line-height: 1.8; }

/* Account options */
.tpas-account-options { padding-left: 18px; color: #555; font-size: 14px; line-height: 1.8; margin-bottom: 20px; }

/* Danger Zone */
.tpas-danger-zone {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #fce4ec;
}
.tpas-danger-zone h4 { color: #c62828; margin-top: 0; margin-bottom: 8px; }
.tpas-danger-zone p { color: #666; font-size: 13px; margin-bottom: 12px; }

/* Portal message (inactive) */
.tpas-portal-message {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #fff3e0;
    border-radius: 12px;
    text-align: center;
    color: #e67e00;
}

/* Wallet page */
.tpas-wallet-page { max-width: 500px; margin: 0 auto; padding: 40px 20px; }
.tpas-wallet-buttons-page { display: flex; flex-direction: column; gap: 12px; margin-top: 25px; }

.tpas-muted { color: #999; font-size: 14px; }

@media (max-width: 768px) {
    .tpas-portal-grid { grid-template-columns: 1fr; }
    .tpas-portal { padding: 10px; }
    .tpas-portal-header-inner { flex-direction: column; text-align: center; }
    .tpas-quick-actions { grid-template-columns: 1fr; }
    .tpas-card, .tpas-card-large { width: 100%; box-sizing: border-box; }
    .tpas-tab { padding: 12px 14px; font-size: 13px; }
}
